home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr35 / vbbs61a2.zip / VSCRIPT.DOC < prev    next >
Text File  |  1993-05-30  |  113KB  |  2,698 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                        ██┐    ██┐ ████████┐ ████████┐ ███████┐
  9.                        ██│    ██│ └██┌──██│ └██┌──██│ ██┌────┘
  10.                         ██┐  ██┌┘  ███████│  ███████│ ███████┐
  11.                          ██┐██┌┘   ██┌──██│  ██┌──██│ └────██│
  12.                           ███┌┘   ████████│ ████████│ ███████│
  13.                           └──┘    └───────┘ └───────┘ └──────┘
  14.                                           *
  15.  
  16.                                  The Virtual BBS/NET
  17.                                     Version 6.10
  18.  
  19.                       (C) Roland De Graaf 1990, 1991, 1992, 1993
  20.  
  21.                                   4246 Elisabeth Ave.
  22.                                   Holland, MI 49424
  23.  
  24.                                           *
  25.  
  26.          ═════════════════════════════════════════════════════════════════
  27.                               VBBS VSCRIPT Documentation
  28.          ═════════════════════════════════════════════════════════════════
  29.          Written By:  Tom Hightower, aka "Baloo"
  30.                          1@1806000 VirtualNET
  31.                       Kevin Klunk, aka "Lord Doomslayer"
  32.                          2@1508000 VirtualNET
  33.          Format By:   Sam Fleming, aka "O. F."
  34.                          1@1205500 VirtualNET
  35.          ═════════════════════════════════════════════════════════════════
  36.  
  37.  
  38.  
  39.                                  TABLE OF CONTENTS
  40.  
  41.                          (1) General VSCRIPT Information
  42.                               1.1 - Script Language Introduction
  43.                               1.2 - General Restrictions
  44.                               1.3 - Script Compiler (VCOM.EXE)
  45.                               1.4 - Command Format
  46.                               1.5 - Special Variables/Constants
  47.                               1.6 - Interfacing with VBBS
  48.                               1.7 - Prepackaged Scripts
  49.  
  50.                          (2) Number and String Handling
  51.                               2.1 - Numeric Operators
  52.                               2.2 - Numeric Functions
  53.                               2.3 - String Operators
  54.                               2.4 - String Functions
  55.                               2.5 - String Alterations
  56.  
  57.                          (3) Display and I/O Commands
  58.                               3.1 - Reading Input
  59.                               3.2 - Showing Line Output
  60.                               3.3 - Colorization
  61.                               3.4 - Other Display Commands
  62.  
  63.                          (4) Database & Message Commands
  64.                               4.1 - Database Selection
  65.                               4.2 - LOAD Related Commands
  66.                               4.3 - Editing Commands
  67.                               4.4 - Viewing & Writing
  68.                               4.5 - E-mail Functions
  69.  
  70.                          (5) Buffer Operation & Use
  71.  
  72.                          (6) File Commands
  73.                               6.1 - Information Commands
  74.                               6.2 - Transfer Commands
  75.                               6.3 - File Editing
  76.  
  77.                          (7) Control Commands
  78.                               7.1 - General Redirection
  79.                               7.2 - Loops & Comparisons
  80.                                      7.21 - DO Loops
  81.                                      7.22 - IF/IFVAL Structures
  82.                                      7.23 - TEST/TESTVAL Commands
  83.                               7.3 - Passing Control
  84.  
  85.                          (8) Miscellaneous Commands
  86.                               8.1 - Visual/Interactive
  87.                               8.2 - User Modifiers
  88.                               8.3 - Real Miscellany
  89.  
  90.                          APPENDIX A - VGIX Commands
  91.                          APPENDIX B - Programmer's Reference Guide
  92.                          APPENDIX C - Script/Function Block Commands
  93.                          APPENDIX D - Common Script Examples
  94.  
  95.  
  96.  
  97.                                              VSCRIPT Documentation --  1
  98.  
  99.  
  100.          ╔════════════════════════════════════════════════════════════════╗
  101.          ║  (1) GENERAL VSCRIPT INFORMATION                               ║
  102.          ╚════════════════════════════════════════════════════════════════╝
  103.  
  104.          1.1 - Script Language Introduction
  105.          ══════════════════════════════════
  106.  
  107.                 One of the features that makes VBBS unique is its script
  108.          language compiler - VCOM.EXE.  Along with the built-in command
  109.          interpreter in VBBS, it allows you to make changes to your BBS
  110.          quickly and easily.  The scripts are nothing more than a series
  111.          of commands listed in a plain ASCII text file, and you don't
  112.          even need to be a programmer to write one.  All you need to cre-
  113.          ate scripts are a text editor or word processor that allows you
  114.          to save in ASCII format (see your word processor documentation
  115.          for more info) and a little patience.  In no time, you will be
  116.          writing up scripts and swapping them with other VBBS sysops like
  117.          a pro.
  118.  
  119.  
  120.          1.2 - General Restrictions
  121.          ══════════════════════════
  122.  
  123.                 The VBBS script language has only one major restriction:
  124.          there can only be a total of 7 'tokens' on a line.  A token is
  125.          defined as either a single unspaced series of characters (for
  126.          example, a command or a number) or any group of characters and
  127.          spaces surrounded by single or double quotes (also called a
  128.          "string".)  The script language is NOT case-sensitive; any
  129.          capitalization used in this text is not required and is done
  130.          only for clarity.
  131.  
  132.                 All the scripts that you create should be placed into your
  133.          scripts directory as defined in VCONFIG - PATHS Configuration;
  134.          see VBBS.DOC for more information on setting your paths.
  135.  
  136.                 The only other restrictions pertain to names.  All of your
  137.          script files MUST have the extension .V and all of your names
  138.          for variables must begin with a '$', e.g., $variable.
  139.  
  140.  
  141.          1.3 - Script Compiler (VCOM.EXE)
  142.          ════════════════════════════════
  143.  
  144.                 The program VCOM.EXE is the compiler that prepares your
  145.          script file for use by VBBS's interpreter.  It takes the script
  146.          file that you have created and builds the two files that VBBS
  147.          actually uses from it.  These two files have the same name as
  148.          the script file but have .LIT and .COD as their extensions.
  149.  
  150.                 Compilation of a script is accomplished by changing to
  151.          your scripts directory and executing the command line:
  152.  
  153.                 VCOM <script name>
  154.  
  155.  
  156.  
  157.                                              VSCRIPT Documentation --  2
  158.  
  159.  
  160.          You do not need to use the extension to compile the script.
  161.          The compiler can detect some errors in the script file during
  162.          the compilation.  These errors are predominantly related to the
  163.          commands that 'jump' around within a script.  These commands
  164.          are GO, TEST, TESTVAL, CALL, and BREAK.  If an error is found
  165.          the compiler will abort and you will need to go into your
  166.          script to correct the error.
  167.  
  168.  
  169.          1.4 - Command Format
  170.          ════════════════════
  171.  
  172.                 All commands will be listed in the form:
  173.  
  174.                     Command Name ->  Command Syntax.
  175.                              <description of command here>
  176.  
  177.          The following conventions will be used in all command syntax
  178.          in this document:
  179.  
  180.            COMMAND     - All commands will be in capitals and must be
  181.                          typed in the format shown (see the note below.)
  182.            <label>     - A single word, no quotes or spaces.
  183.            <variable#> - Any variable name (only).
  184.            <number#>   - Any numeric value (only).
  185.            <string#>   - A string value ("aBc 123") or any variable name.
  186.            <value#>    - A numeric value or any variable name that is
  187.                          used to store numeric values.
  188.            <pathfile#> - A legal DOS filename including path information.
  189.                          If the path is excluded it will default to the
  190.                          BBS' main directory.  A variable that stores the
  191.                          correct path/filename info may also be used.
  192.            <filename#> - A legal DOS filename excluding path information.
  193.                          Commands that use this have the path info set
  194.                          automatically.  A variable that has the filename
  195.                          stored in it may also be used.
  196.            <prompt>    - Either a text string or a variable name.  Most
  197.                          of these are optional, so use them only if you
  198.                          want them.
  199.            <relation>  - Any of the following, but see the specific com-
  200.                          mand for verification:
  201.  
  202.                            = Equal to         <> Not equal to
  203.                            > Greater than     >= Greater than or equal to
  204.                            < Less than        <= Less than or equal to
  205.  
  206.            <option>    - The value of this item is command-specific.
  207.            <token#>    - Any single item; see section 1.2 for a complete
  208.                          definition of a token.
  209.  
  210.            Note: If the command name is followed by a '<---' then the
  211.                  syntax for the command is just the command name.
  212.  
  213.  
  214.  
  215.                                              VSCRIPT Documentation --  3
  216.  
  217.  
  218.          1.5 - Special Variables/Constants
  219.          ═════════════════════════════════
  220.  
  221.                 The script language contains the following restricted
  222.          variables, which are read-only:
  223.  
  224.            $AGE       - Age of user.
  225.            $ANSI      - Stores the user's current graphics setting.  Set
  226.                         to OFF if using ASCII, ON if using ANSI, and ENH
  227.                         if using PDM's.
  228.            $AVAILABLE - Stores the sysop availability flag. Y if sysop is
  229.                         available, N if not.
  230.            $BAUD      - Stores the user's connect speed.
  231.                         Returns "" if logged into node 0 (or other local
  232.                         node) and returns "CONSOLE" if logged in locally
  233.                         from the WFC screen.
  234.            $BBSNAME   - Stores the BBS' name, as shown in VCONFIG.
  235.            $BELL      - Stores ASCII code 7, causes a beep when printed.
  236.            $BIRTHDATE - User birthdate in same format as $DATE.
  237.            $BS        - Stores ASCII code 8, causes the cursor to back up
  238.                         1 space on current line when printed.  It is not
  239.                         a destructive backspace.
  240.            $CLEAR     - Stores <CTRL>-<L> for ASCII users, stores the ANSI
  241.                         clear screen code for others when printed.
  242.            $<color>   - These nine variables are reserved as color codes:
  243.                         $RED, $BLUE, $CYAN, $GREEN, $YELLOW, $MAGENTA,
  244.                         $WHITE, $BLACK, and $NORM.  See section 3.3 for
  245.                         more information.
  246.            $CR        - Stores ASCII code 13, causes a carriage return
  247.                         when printed (moves to column 1, current line.)
  248.            $CREDITS   - Number of credits user has.
  249.            $CRLF      - Causes both a $CR & $LF when printed (moves to
  250.                         column 1 of the next line.)
  251.            $DATE      - Stores the current system date as MM-DD-YYYY.
  252.            $EXTRAx    - The users extra variables values are stored in
  253.                         $EXTRA1 thru $EXTRA8.  They can be changed with
  254.                         the SETEXTRA command.  See section 8.2 for info.
  255.            $FLAGS     - This contains the list of all active general
  256.                         flags of the current user.  Use the INSTR command
  257.                         with $FLAG and you will know if a particular flag
  258.                         is on if the result is non-zero.  You can change
  259.                         the value of a flag with the SETFLAG command.  See
  260.                         section 8.2 for info.
  261.            $HANDLE    - User's handle.
  262.            $LF        - Stores ASCII code 10, causes a linefeed when it's
  263.                         printed (same column position, next line.)
  264.            $MAXTIME   - Maximum minutes per day.
  265.            $NAME      - User's real name.
  266.            $NODE      - Stores your VirtualNET node # as set in VCONFIG.
  267.                         Default is 0 if you are not in VirtualNET.
  268.            $PAGE      - Number of lines to print before pause.
  269.            $PORT      - Returns present channel # of user (not COM port!)
  270.            $SECURITY  - User's security level, 250 and up is considered
  271.                         Co-sysop/Sysop access.  Use TESTVAL and this
  272.                         variable to implement your own security.
  273.  
  274.  
  275.                                              VSCRIPT Documentation --  4
  276.  
  277.  
  278.            $SYSOP     - Stores the sysop's name as set in VCONFIG.
  279.            $TEXTPATH  - Stores the path to your TXT directory.
  280.            $TIME      - Stores the current system time.
  281.            $TIMELEFT  - Number of minutes left for this session.
  282.            $TIMEON    - Number of minutes on for this session.
  283.            $TIMESON   - Total number of logons for the user.
  284.            $TOTALMIN  - Total number of minutes on since first logon.
  285.            $USER      - User's account number.
  286.            $VIDEOMODE - This stores values similar to $ANSI, only they are
  287.                         #'s instead of words.  Set to 0 if using ASCII, 1
  288.                         if using ANSI, 2 if using PDM's, and 3 if using
  289.                         VGIX.
  290.  
  291.  
  292.          1.6 - Interfacing with VBBS
  293.          ═══════════════════════════
  294.  
  295.                There are only two ways that you can run a script. You can
  296.          either run the script from a function block or LINK to it from
  297.          another script.  The former is covered here and the latter is
  298.          covered in section 7.3 - Passing Control.
  299.  
  300.                 Go into the function block you wish to have run the script
  301.          and add the following line on any but the first two lines in the
  302.          .FB file:
  303.  
  304.            Z 001 2 Scripter
  305.            |  |  |   ^------This is the script name, NO extension.
  306.            |  |  ^----------This is the code to tell VBBS it is running a
  307.            |  |             script
  308.            |  ^-------------This is the SL to be able to use the key (and
  309.            |                run the script.)
  310.            ^----------------This is the key to press at the menu to load
  311.                             and run the script.
  312.  
  313.  
  314.          1.7 - Prepackaged Scripts
  315.          ═════════════════════════
  316.  
  317.          --> IMPORTANT NOTE:  This section is best read after reading
  318.                               through the entire file but is included here
  319.                               to maintain the structure of this document.
  320.                               Do not let the unknown terms interfere with
  321.                               your reading, as they will all be explained
  322.                               elsewhere.
  323.  
  324.                 There are many script authors out in the BBSing community
  325.          that have written all sorts of scripted programs to perform prac-
  326.          tically everything you could ever want.  The most difficult part
  327.          of using a script is knowing how to install it.  What you should
  328.          do first is pull up the script and look for comments that explain
  329.          the script.  Some will contain complete sets of instructions,
  330.          while others will contain no comments at all.  If the script con-
  331.          tains few or no comments, then what you will need to do is:
  332.  
  333.  
  334.                                              VSCRIPT Documentation --  5
  335.  
  336.                 1> Make sure that all EXIT and LINK statements point to
  337.                    FB's or scripts that you actually have. If all else
  338.                    fails you can set all of these statements to EXIT
  339.                    to your main FB file (see VBBS.DOC for information.)
  340.                 2> Look for any statements that use file commands.  Be
  341.                    sure to change these to valid paths on your system.
  342.                 3> See if the script has any RET lines.  If it does,
  343.                    try to find the CALL statements to the labels that
  344.                    appear a few lines before the RET.
  345.  
  346.          After you have done these steps you will then have the info you
  347.          need to determine how the script should be used.  If the script
  348.          has no EXIT or LINK statements, or the script has a RET line with
  349.          no CALL statement, then you must make the script part of an exis-
  350.          ting one.  The easiest way to do this is to just block-copy the
  351.          entire script in before your final EXIT or LINK statement in your
  352.          script if it has no unmatched RET statements.
  353.  
  354.                 If there is an unmatched RET statement, then installing
  355.          the new script is even easier.  Somewhere in your script you need
  356.          to add a CALL <label> statement with <label> being the label at
  357.          the start of the new script.  Then just add as the last line of
  358.          your script the line '& <script name>'.  You should be able to
  359.          compile and run it at this point.  Just remember, 'Nothing is
  360.          Guaranteed!', so if you have a problem with a script and you
  361.          can't get it to work try to either pick the code apart (if you
  362.          can) or hop onto any VirtualNet BBS that carries a script dis-
  363.          cussion sub and ask a few questions (or a few hundred, as
  364.          needed.)  One of the script gurus may be able to help you out,
  365.          and you might even be able to get in touch with the author.
  366.  
  367.  
  368.  
  369.                                              VSCRIPT Documentation --  6
  370.  
  371.  
  372.          ╔════════════════════════════════════════════════════════════════╗
  373.          ║  (2) NUMBER AND STRING HANDLING                                ║
  374.          ╚════════════════════════════════════════════════════════════════╝
  375.  
  376.  
  377.          2.1 - Numeric Operators
  378.          ═══════════════════════
  379.  
  380.                 VSCRIPT supports the following mathematical operators:
  381.  
  382.                        +  Addition           -  Subtraction
  383.                        *  Multiplication     /  Division
  384.                        ^  Exponentiation
  385.  
  386.          All math commands in the script language are performed from
  387.          left-to-right.  Parentheses can NOT be used in a formula, so
  388.          any math that needs to be done in a hierarchical format must be
  389.          done over more than one line.  Also, remember the restriction
  390.          on 'tokens' - a math symbol counts as a token, so only two math
  391.          operations can be performed on one line.
  392.  
  393.                    Example:                   Results:
  394.                    $a= 2 * 2 + 4              => 4 + 4       => 8
  395.                    $b = $a + 2 / 5            => 10 / 5      => 2
  396.                    $c = $b + 5 - 4            => 7 - 4       => 3
  397.                    $d = 4 / $b ^ 3            => 2 * 2 * 2   => 8
  398.  
  399.  
  400.          2.2 - Numeric Functions
  401.          ═══════════════════════
  402.  
  403.          INT 0 ->  <variable1> = <value2> INT 0
  404.  
  405.                This function takes the number stored in <value2> and
  406.            rounds down to the next lower whole number.  The resulting
  407.            integer is then stored in <variable1>.  Remember: negative
  408.            numbers also round down with this function as shown below:
  409.  
  410.                $total = -11.25 INT 0 returns a value of -12, not -11.
  411.  
  412.          SQR 0 ->  <variable1> = <value2> SQR 0
  413.  
  414.                This function returns the square root of the absolute
  415.            value of the number stored in <value2>.  The result is then
  416.            stored in <variable1>.  Note: The absolute value of a number
  417.            equals its positive value, ie absolute of -11 = 11.
  418.  
  419.          RND ->  <variable1> = <value1> RND <value2>
  420.  
  421.                This function generates a random number between the two
  422.            <value>'s.  If <value1> is smaller than <value2> then the
  423.            result will not include either number.  If <value1> is larger
  424.            than <value2> then the result can include either number.
  425.  
  426.  
  427.                                              VSCRIPT Documentation -- 7
  428.  
  429.  
  430.              Example:                Results:
  431.              $a = 4.15 * 4 + .25     => 16.85
  432.              $b = $a INT 0           => 16
  433.              $c = $b SQR 0           => 4
  434.              $d = $a INT 0 SQR 0     => 4
  435.              $e = $b RND $c          => a random number from 4 to 16
  436.              $f = $c RND $b          => a random number from 5 to 15
  437.  
  438.  
  439.          2.3 - String Operators
  440.          ══════════════════════
  441.  
  442.            & ->  <variable1> = <token3> & <token5> & <token7>
  443.  
  444.                This allows you to link together many variables and strings
  445.            to print as a single variable, effectively adding many tokens
  446.            together. ex: $Junk = "This is" & " one big " & "statement!"
  447.  
  448.  
  449.          2.4 - String Functions
  450.          ══════════════════════
  451.  
  452.                In addition to the '&' operators there are some functions
  453.            for use with strings and variables that store strings.
  454.  
  455.          ASC 0 ->  <variable1> = <string2> ASC 0
  456.  
  457.                This function finds the ASCII code of the first character
  458.            in <string2> and stores it in <variable1>.
  459.  
  460.          CHR 0 ->  <variable1> = <value2> CHR 0
  461.  
  462.                This function takes <value2> and places the character with
  463.            the matching ASCII code into <variable1>.
  464.  
  465.          LEN 0 ->  <variable1> = <string2> LEN 0
  466.  
  467.                This function returns the number of characters within
  468.            <string2> and places the result in <variable1>.
  469.  
  470.          UPPER 0 ->  <variable1> = <string2> UPPER 0
  471.  
  472.                This function returns the upper case equivalent of what is
  473.            in <string2>.  It only changes the lower case letters, leaving
  474.            all numbers and symbols as they are in the original <string2>.
  475.  
  476.          INSTR ->  <variable1> = <string2> INSTR <string3>
  477.  
  478.                This function scans <string2> to see if <string3> exists
  479.            within it.  It returns a 0 to <variable1) if it is not found,
  480.            otherwise it returns the position of <string3>.
  481.  
  482.  
  483.                                              VSCRIPT Documentation --  8
  484.  
  485.  
  486.          MID   ->  <variable1> = <string2> MID <value3>
  487.          LEFT  ->  <variable1> = <string2> LEFT <value3>
  488.  
  489.                These functions return portions of a string. MID starts
  490.            at the character <value3> and returns the rest of the string.
  491.            LEFT starts at the left-most character and returns a number
  492.            of characters equal to <value3>.
  493.  
  494.            Example:                      Results:
  495.            $a = "aBc2" & "05 D" & "e╫Fg" => "aBc205 De╫Fg"
  496.            $b = $a MID 10                => ╫Fg
  497.            $c = $b ASC 0                 => 215 - the ASCII code for ╫
  498.            $d = $a LEFT 6 MID 4          => 205
  499.            $e = $d CHR 0                 => ═   - the ASCII 205 character
  500.            $f = $a INSTR "205"           => 4   - the 205 is in the string
  501.                                                   and the 2 is located in
  502.                                                   the 4th position.
  503.            $g = $a LEN 0                 => 12
  504.            $h = $a UPPER 0               => "ABC205 DE╫FG"
  505.  
  506.            Note: The quotes in the strings are not an actual part of the
  507.                  strings.  They are there only to denote the beginning
  508.                  and end of a single token.
  509.  
  510.  
  511.          2.5 - String Alterations
  512.          ════════════════════════
  513.  
  514.                There are a few commands that actually allow you to alter
  515.            the format of a variable.  All of them use the same syntax and
  516.            are described below.
  517.  
  518.          JC ->  JC <variable1> <value2>
  519.          JL ->  JL <variable1> <value2>
  520.          JR ->  JR <variable1> <value2>
  521.  
  522.                These commands all take what is stored within <variable1>
  523.            and pad it with extra spaces.  JC centers the <variable1> in
  524.            a field of <value2> spaces.  JL places it along the left margin
  525.            and JR places it on the right margin in a similar field.
  526.  
  527.            Example:                     Results:
  528.            $size = 14
  529.            $a = "Greed!"                => $a now has the value:
  530.            JC $a $size                     "    Greed!    "
  531.            $b = "Green!"                => $b now has the value:
  532.            JL $b $size                     "Green!        "
  533.            $c = "Groan!"                => $c now has the value:
  534.            JR $c $size                     "        Groan!"
  535.  
  536.  
  537.                                              VSCRIPT Documentation --  9
  538.  
  539.  
  540.          ╔════════════════════════════════════════════════════════════════╗
  541.          ║ (3) INPUT AND OUTPUT COMMANDS                                  ║
  542.          ╚════════════════════════════════════════════════════════════════╝
  543.  
  544.  
  545.          3.1 - Reading Input
  546.          ═══════════════════
  547.  
  548.                One of the most common uses of a script is to get some
  549.            information from a user and the script language contains many
  550.            commands to help implement this task.  All the commands allow
  551.            for a <prompt> string, but this is optional so you do NOT have
  552.            to use it if you do not want to.
  553.  
  554.          GETYN ->  GETYN <variable1> <prompt>
  555.          GETNY ->  GETNY <variable1> <prompt>
  556.  
  557.                These two commands show the user whatever is stored within
  558.            the <prompt> and ask for a response of Y, N, or <enter>.  The
  559.            GETYN command defaults to Y when then user presses <enter> and
  560.            GETNY defaults to N.
  561.            ex: GETYN $yesorno "Do you wish to continue ? "
  562.  
  563.          RS ->  RS <variable1> <prompt>
  564.  
  565.                This command prints the optional <prompt> and then accepts
  566.            a line of input.  The input can be no more than 81 characters
  567.            in length, and input is terminated by pressing <enter>.
  568.            ex: RS $yourname "What is your name ? "
  569.  
  570.          RX ->  RX <variable1> <prompt>
  571.  
  572.                This command works like the RS command but instead of it
  573.            echoing the keys that the user presses it prints X's.  This is
  574.            very useful for password systems.
  575.  
  576.          RW ->  RW <variable1> <prompt>
  577.  
  578.                This command works like the RS command with the only real
  579.            difference being that this command has a word-wrapping feature.
  580.            If a word passes the 80 character point it is word-wrapped over
  581.            to the next input line.  To prevent the extra characters from
  582.            being placed into the next input statement you will need to
  583.            place 'Buffer Clear' after the last RW input line.  See section
  584.            5.x for more info on buffer commands.
  585.  
  586.          RN ->  RN <variable1> <prompt>
  587.  
  588.                This command prints the optional prompt and then accepts
  589.            only numerical input.  It will not take any keys but the #'s
  590.            and input is terminated by pressing <enter>.
  591.            ex: RN $number "Enter your favorite number : "
  592.  
  593.  
  594.                                              VSCRIPT Documentation -- 10
  595.  
  596.  
  597.          RC ->  RC <variable1> <prompt>
  598.  
  599.                This command prints the optional <prompt> and then waits
  600.            for a single character to be pressed.  The character is stored
  601.            in <variable1> but it is not shown on the screen.
  602.            ex: RC $onechar "Pick a key, any key : "
  603.  
  604.          RR ->  RR <variable1> <string2> <prompt>
  605.  
  606.                This command operates in the same way as the RC command
  607.            with only one difference.  It will only accept characters that
  608.            are listed in the <string2>, all others will be ignored.
  609.            ex: RR $thisone ARI "A>bort, R>etry, I>gnore ? "
  610.  
  611.          RL ->  RL <variable1> <string2> <value3> <prompt>
  612.  
  613.                This command operates similarly to the RR command.  It will
  614.            accept any character listed in <string2> and also will accept a
  615.            number between 1 and <value3>.  This is the most versatile form
  616.            for getting input, and is most commonly used for creating a
  617.            menu within a script.
  618.            ex: RL $thatone ABC 3 "Choose A, B, C, 1, 2, or 3 : "
  619.  
  620.          RF ->  RF <variable1> <prompt>
  621.  
  622.                This command is used to get a filename as input.  It will
  623.            only accept input in the format 'xxxxxxxx.xxx' with each 'x'
  624.            being a character.  It will only allow legal characters for the
  625.            name and it will not accept globals (* and ?.)  The complete
  626.            list of acceptable characters contains A thru Z (uppercase is
  627.            forced automatically) and the symbols => ! # $ _ - (the => is
  628.            not in the list, it is used only for emphasis.)
  629.            ex: RF $filename "Name of file to be uploaded : "
  630.  
  631.          RI ->  RI <variable1> <prompt>
  632.  
  633.                This command is nearly identical to the RF command.  The
  634.            one difference being that this command accepts the * and ?
  635.            globals in the filename.
  636.            ex: RI $filetoget "Name of file to find (* and ? allowed) : "
  637.  
  638.  
  639.          3.2 - Showing Line Output
  640.          ═════════════════════════
  641.  
  642.                There are two different ways that you can show output one
  643.            line at a time.  While they are slightly different, both accept
  644.            the same formatting information for their output.
  645.  
  646.          TR ->  TR <token2> <token3> <token4> ... <token7>
  647.          TS ->  TS <token2> <token3> <token4> ... <token7>
  648.  
  649.                These commands can print out up to 6 different tokens using
  650.            a single line.  After the last token on the line is printed the
  651.  
  652.  
  653.                                              VSCRIPT Documentation -- 11
  654.  
  655.  
  656.            TR command performs a carriage return/linefeed while the TS
  657.            command does not.
  658.  
  659.            The three formatting statements are listed below.
  660.  
  661.            %s ->  %s<number1> <variable2>
  662.  
  663.                Outputs <variable2> in a field of <number1> spaces and then
  664.            left justifies it.
  665.  
  666.            %i ->  %i<number1> <variable2>
  667.  
  668.                Outputs <variable2> in a field of <number1> spaces and then
  669.            right justifies it.
  670.  
  671.            %d ->  %d<number1>.<number2> <value3>
  672.  
  673.                Outputs <value3> with the format ###.## where <number1> and
  674.            <number2> are the ### and the .## respectively.  The left part
  675.            of the output is padded with spaces and the right is padded
  676.            with 0's.  This format uses the absolute value of <value3>, so
  677.            the output is always a positive number.
  678.  
  679.                You can use any numbers within the statements as long as
  680.            you follow the specified syntax.  If the field selected is too
  681.            small for the variable then the output will be chopped down to
  682.            fit it into the field.
  683.  
  684.            Example:                     Results:
  685.            $a = "Green"
  686.            $b = 16.2312
  687.            tr $b " : " %d3.3 $b         => "16.2312 :  16.231"
  688.            tr %s10 $a ":" %i10 $a       => "Green     :     Green"
  689.            ts $b " : "
  690.            tr $a " : The End"           => "16.2312 : Green : The End"
  691.  
  692.            Note: The quotes are not in the actual output, they are only
  693.                  supplied to emphasize the blank spaces.
  694.  
  695.  
  696.  
  697.          3.3 - Colorization
  698.          ══════════════════
  699.  
  700.                There are three different ways to change color in the
  701.            script language.  All are identical in output, but each has
  702.            a unique form of implementation.  Note: <color code> is the
  703.            number (0-9) or letter (capital A-Z) code that corresponds to
  704.            the colors as listed in the COLORS.TXT file.  Also, the input
  705.            commands from section 3.1 (RS, RW, RX, etc.) will all change
  706.            the color to the user's default prompt setting unless the
  707.            <prompt> has a color code within it.
  708.  
  709.  
  710.                                              VSCRIPT Documentation -- 12
  711.  
  712.  
  713.          ANSIC ->  ANSIC <color code>
  714.  
  715.                This command is executed on a line by itself and changes
  716.            the effective color to that of the selected <color code>.
  717.  
  718.          $<color> ->  Special
  719.  
  720.                The $color commands are actually individual tokens that
  721.            resemble variable names.  As such, they may be included into
  722.            other strings with the '&' command (section 2.3) or used on
  723.            their own in output statements (TR & TS.)
  724.  
  725.                 $<color>   color code      $<color>   color code
  726.                 --------   ----------      --------   ----------
  727.                 $RED           6           $YELLOW        2
  728.                 $BLUE          7           $MAGENTA       B
  729.                 $GREEN         5           $CYAN          1
  730.                 $WHITE         U           $NORM          0
  731.                 $BLACK        n/a
  732.  
  733.                The command $BLACK makes very dark letters though they may
  734.            be visible, depending on your system configuration.  A common
  735.            use for this is to cover over ANSI music symbols.
  736.  
  737.          Hearts ->  Special
  738.  
  739.                The most frequently used way to change colors is to use
  740.            what has been coined 'Heart-code ANSI.'  The Heart code is the
  741.            ASCII code 3 and can be created in a couple of different ways.
  742.            If your ANSI driver supports the extended ASCII character set
  743.            you can create the 'heart' by pressing the <CTRL> key and the
  744.            <C> key or it can be made by holding down the <ALT> key, then
  745.            press 3 (or 003 or 259) on the number pad and then releasing
  746.            the <ALT> key.  You will have to test this for your particular
  747.            system to see which works for you.  You can also create the
  748.            codes by using the full-screen editor to colorize although this
  749.            can be a bit of work.  Immediately after the 'heart' you place
  750.            the desired <color code> and when the script actually runs,
  751.            VBBS will show the correct color (you will not see the 'heart'
  752.            or the next character after it.)
  753.  
  754.           Example:
  755.              These -----\_______/ANSIC 6
  756.              three      |       \TR "Hello ! " $handle
  757.              pieces     |
  758.              of code    |_______/$stuff = $red & "Hello ! " & $handle
  759.              all do     |       \TR $stuff
  760.              the exact  |
  761.              same thing-/-------<TR "<heart>6Hello ! " & $handle
  762.  
  763.  
  764.                                              VSCRIPT Documentation -- 13
  765.  
  766.  
  767.          3.4 - Other Display Commands
  768.          ════════════════════════════
  769.  
  770.          EF ->  EF <pathfile1>
  771.  
  772.                This command displays the contents of the specified file
  773.            in <pathfile1>.  It will pause whenever the users screen fills
  774.            and continue when a key is pressed.
  775.  
  776.          DRAWWAITBAR ->  DRAWWAITBAR <value1>
  777.  
  778.                This command draws a string of green o's surrounded by red
  779.            []'s. The number of o's is equal to <value1>.  The cursor is
  780.            then placed on the first 'o' so you can write over it with
  781.            another character.  See Appendix D for an example.
  782.  
  783.          LOC ->  LOC <value1> <value2>
  784.  
  785.                This command places the cursor at the location equal to the
  786.            (x, y) coordinates that match (<value2>, <value1>).  Legitimate
  787.            values for <value1> are 1-25 and for <value2> are 1-80. This
  788.            only operates for users of ANSI, Enhanced ANSI, and VGIX.
  789.  
  790.          MENU ->  MENU <filename1>
  791.  
  792.                This command displays a menu file stored in your text
  793.            directory (as set in VCONFIG.)  VBBS first checks to see if
  794.            <filename>.MNU exists, and shows it if true.  Otherwise it
  795.            shows <filename>.ANS if the user has ANSI and <filename>.ASC
  796.            otherwise.
  797.  
  798.                The .MNU files are universal text files colorized with
  799.            VBBS' heart-code ANSI colors.  If the user has ANSI then the
  800.            file displays w/ the colors, but if the user does not have
  801.            ANSI then it is displayed without the colors.  You can still
  802.            use .ANS and .ASC menus if you like, however.
  803.  
  804.                If ! is the first character of a line in a menu then VBBS
  805.            will only show the line if the user's security level is greater
  806.            than or equal to the three-digit number that follows the '!'.
  807.  
  808.            Examples:
  809.            !255 S) SysOp Menu  <== Not shown unless the user has SL >= 255.
  810.            !100 F) Forward     <==  "    "     "     "   "    "   " >= 100.
  811.  
  812.          NEWPAGE <---
  813.          SUSPENDPAGEBREAK <---
  814.          RESUMEPAGEBREAK <---
  815.  
  816.                These three commands alter the user's page-break pointer.
  817.            This pointer determines how many lines of text have been viewed
  818.            and the user's screen length (as set in defaults) determines
  819.            when a pause should be used.  NEWPAGE resets the pointer to 0
  820.  
  821.  
  822.                                              VSCRIPT Documentation -- 14
  823.  
  824.  
  825.            so the output will scroll for a number of lines equal to the
  826.            value set in the user's defaults.  SUSPENDPAGEBREAK turns the
  827.            use of the pointer off completely (no pauses at all), while
  828.            RESUMEPAGEBREAK turns the pointer back on.
  829.  
  830.          PAUSE ->  PAUSE <prompt>
  831.  
  832.                This displays the optional <prompt> or the default prompt
  833.            as set in VCONFIG.  It then waits for a keypress and erases
  834.            the prompt before continuing.
  835.  
  836.  
  837.                                              VSCRIPT Documentation -- 15
  838.  
  839.  
  840.          ╔════════════════════════════════════════════════════════════════╗
  841.          ║ (4) DATABASE OPERATIONS                                        ║
  842.          ╚════════════════════════════════════════════════════════════════╝
  843.  
  844.  
  845.                Each database (DB) in VBBS can be used in many different
  846.            ways for storing info.  A DB can store normal messages, file
  847.            descriptions, or even messages with attached files. Also, there
  848.            is no reason why you can't redefine the fields and use them for
  849.            other types of data storage, like a special voting booth or
  850.            customized daily news section.
  851.  
  852.                Each DB entry is made up of two parts - The Header and the
  853.            Memo Section. The Header contains things like the subject, the
  854.            sender's name, addressee, etc. The Memo Section is the actual
  855.            body of the entry.  The body, while always text, may contain
  856.            either a standard message or a long file description, depending
  857.            on how you are using the database.
  858.  
  859.  
  860.          4.1 - Database Selection
  861.          ════════════════════════
  862.  
  863.                Before you can implement any database commands you must
  864.            first select the exact database you wish to use.  This is done
  865.            with the commands DBGROUP and DB.  You must use the commands
  866.            in the order shown for proper results.
  867.  
  868.           DBGROUP ->  DBGROUP <group identifier>
  869.  
  870.                This selects the database group that you will be using in
  871.            the script.  The <group identifier> is the letter representing
  872.            the DBG as it appears in VCONFIG.  See VBBS.DOC for more info.
  873.            ex: DBGROUP A     <-- This makes DBGroup A the active area.
  874.  
  875.                Before you can select a database to use, you must first
  876.            select a database group.  Grouping was implemented so that it
  877.            would be much easier to implement global functions and so that
  878.            databases may be added and deleted (using VCONFIG.EXE) without
  879.            the need to edit the scripts every time.  The <group identifier>
  880.            is a single alphabetic character (from A to Z) and you can set
  881.            your database groups up any way you like.  A common set of DB
  882.            Groups might be:
  883.            <A> Public message bases    <H> Hidden/restricted message bases
  884.            <F> Public file bases       <I> Hidden/restricted file bases
  885.            <O> Special bases like voting sections, daily news, etc.
  886.  
  887.            The following read-only variables are loaded when you execute
  888.            the DBGROUP command:
  889.            --------------------
  890.            $DBNUMBER - Stores the total number of databases in the selected
  891.                        group.  The lowest numbered DB in a group is always
  892.                        a 1, so this number supplies the upper limit for
  893.                        loop operations within a database group.
  894.  
  895.  
  896.                                              VSCRIPT Documentation -- 16
  897.  
  898.  
  899.            $DBGROUP  - This stores the letter you selected on the DBGROUP
  900.                        command line. Note: This variable is not cleared
  901.                        when you LINK to another script (see section 7.3),
  902.                        so this can be used to keep track of your location.
  903.            --------------------
  904.  
  905.          DB ->  DB <database number>
  906.  
  907.                The DB commands sets the current database for use. You
  908.            must select a database using this command somewhere in your
  909.            script before any of the other database commands (except
  910.            DBGROUP) are used. Once you set the database, it stays set
  911.            until another DB command is executed. Also, the database must
  912.            have been defined previously using VCONFIG.EXE.
  913.  
  914.            The following read-only variables are loaded when you execute
  915.            the DB command:
  916.            --------------------
  917.            $DB       - This stores the database number you have selected.
  918.                        Like $DBGROUP it is not cleared when you LINK
  919.                        between scripts and so using the two variables you
  920.                        can maintain a constant position within your DBs.
  921.            $DBNAME   - The long name of the selected database.
  922.            $DBPATH   - The path (if any) in the 'File Path' section of the
  923.                        VCONFIG Database entry.
  924.            $DBFILE   - The filename of the actual database storage file.
  925.            $HIGHDB   - This is the pointer that stores the number of the
  926.                        user's highest-read entry in the database.
  927.            $NUMBERDB - This stores the total number of entries in the
  928.                        database.
  929.            $WRITESL  - This contains the minimum security level needed to
  930.                        write to the database.
  931.            --------------------
  932.  
  933.  
  934.          4.2 - LOAD Related Commands
  935.          ═══════════════════════════
  936.  
  937.                The next few commands are all used to manually load in a
  938.            database entry for display and/or analysis.
  939.  
  940.          LOAD ->  LOAD <value1> <option>
  941.  
  942.                This command loads the database entry <value1> and has
  943.            one command <option>. Adding /Q to the command line will set
  944.            it so the user's $HIGHDB pointer is not updated. The command
  945.            also loads the following variables:
  946.            --------------------
  947.            $ATTFILE  - Filename of a file that is attached to the message,
  948.                        if any.
  949.            $DBCOUNT  - This variable starts at 0 and can be increased by
  950.                        using the ADDCOUNT command (see section 4.3).  It
  951.                        can not be decreased and has one value for each DB
  952.                        (not for each individual message or file.)
  953.  
  954.  
  955.                                              VSCRIPT Documentation -- 17
  956.  
  957.  
  958.            $DBDATE   - Creation date and time of the entry.
  959.            $DBFLAG   - The value can have a value of 0 or 1 and can be
  960.                        toggled with the DBFLAG command (see section 4.3).
  961.                        The value of this variable is constant, so if it is
  962.                        turned ON it is treated as ON for all users who
  963.                        access the message/file affected.
  964.            $FROM     - The handle of the person who created the entry.
  965.            $FROMNO   - The user # of the person who created the entry.
  966.            $FROMNODE - VirtualNET node number of sender.
  967.            $SIZE     - Size of attached file, set to 0 if none.
  968.            $SUBJECT  - The subject of the message, or brief description
  969.                        for a file entry.
  970.            $TO       - The handle of the addressee, if any.
  971.            $TONO     - The user # of the addressee, 0 if to ALL.
  972.            $TONODE   - VirtualNET node number of addressee.
  973.            $RESULT   - This variable contains one of these items:
  974.                          DEL if <value1> is marked for deletion
  975.                          OUT if <value1> is greater than the number of
  976.                              available entries (listed in $NUMBERDB)
  977.                          PRI if the DB is private and the user is not
  978.                              the sender, addressee, or has an SL below
  979.                              250 (ie Sysop or CoSysop)
  980.                          OK  in all other cases
  981.            --------------------
  982.  
  983.          DISPLAYMSG <---
  984.  
  985.                This command displays the message header info to the user.
  986.            It will clear the screen before showing this info if the user
  987.            is using enhanced ANSI (see VBBS.DOC for more information.)
  988.  
  989.          DISPLAYTEXT <---
  990.  
  991.                This command displays the memo section of the message to
  992.            the user.  It clears the screen like DISPLAYMSG for enhanced
  993.            ANSI users.
  994.  
  995.  
  996.          4.3 - Editing Commands
  997.          ══════════════════════
  998.  
  999.                All of these commands operate independently of the LOAD
  1000.            command.  They do still require you to select a DBGROUP and DB
  1001.            before use, however.
  1002.  
  1003.          ADDCOUNT ->  ADDCOUNT <value1>
  1004.  
  1005.                This command increases the number stored in the $DBCOUNT
  1006.            by 1 if <value1> is a positive number.
  1007.  
  1008.  
  1009.                                              VSCRIPT Documentation -- 18
  1010.  
  1011.  
  1012.          CLEANUP <---
  1013.  
  1014.                This performs the PACK function (below) on all databases.
  1015.            This command does not require the use of the DBGROUP or DB
  1016.            commands before use.
  1017.  
  1018.          DBFLAG ->  DBFLAG <value1> <switch>
  1019.  
  1020.                This command toggles the value stored in $DBFLAG for the
  1021.            entry <value1>.  The valid switches are ON or OFF and the
  1022.            matching $DBFLAG values are 1 and 0, respectively.
  1023.  
  1024.          DEL ->  DEL <value1>
  1025.  
  1026.                This command marks the entry <value1> for deletion.  It
  1027.            also returns the $RESULT variable with the possible values
  1028.            being OUT, PRI, and OK (see LOAD entry above.)
  1029.  
  1030.          PACK <---
  1031.  
  1032.                This command deletes all messages within the selected DB
  1033.            that have been marked for deletion and then resequences the
  1034.            database.  All user and network pointers are automatically
  1035.            updated to show the change in message numbers.
  1036.  
  1037.          QS ->  QS <value1>
  1038.  
  1039.                Manually set the user's $HIGHDB pointer to <value1>. If
  1040.            <value1> exceeds the value in $NUMBERDB then $HIGHDB is set
  1041.            to equal $NUMBERDB.
  1042.  
  1043.          SAVE -> (command on next line due to length)
  1044.          SAVE <value1> <value2> <string3> <value4> <filename5> <value6>
  1045.  
  1046.                This command makes a database entry and saves it in the
  1047.            current database.  The variables used are:
  1048.            --------------------
  1049.            <value1>    - This is the user # that the message is addressed
  1050.                          to, this should be set to 0 if to ALL.
  1051.            <value2>    - This is the network address of the addressee,
  1052.                          use $NODE if the addressee is local.
  1053.            <string3>   - This will be the $SUBJECT of the saved message.
  1054.            <value4>    - This contains the size of the attached file, use
  1055.                          0 if none.
  1056.            <filename5> - This is the name of the attached file, use "" if
  1057.                          none.
  1058.            <value6>    - This is the network ID of the addressee, use 1 if
  1059.                          the addressee is local.
  1060.            --------------------
  1061.                The message saved uses the above information to create the
  1062.            header and then takes the contents of the buffer and uses it as
  1063.            the main body of the message.  See section 5.x for information
  1064.            on how to use the buffer.  This command can not be used to send
  1065.            files attached to emails, it can only be used to add files to a
  1066.            database listing.
  1067.  
  1068.  
  1069.                                              VSCRIPT Documentation -- 19
  1070.  
  1071.  
  1072.          SEARCH ->  SEARCH <value1> <number2> <string3>
  1073.  
  1074.                This command searches the contents of the database for
  1075.            <string3> starting at the entry <value1>. The search is case
  1076.            insensitive on <string3>. The value for <number2> can be any
  1077.            of the following:
  1078.              2 - Search the FROM field, <string3> is not used here as it
  1079.                  will always search for the current user's handle.
  1080.              3 - Search the SUBJECT/TITLE field, <string3> can be any word
  1081.                  or group of words.
  1082.              5 - Search the FILENAME field, <string3> must be an acceptable
  1083.                  DOS filename with no wildcards.
  1084.  
  1085.            This command also returns two variables:
  1086.            --------------------
  1087.            $RESULT = OUT if <string3> is not found, OK if otherwise.
  1088.            $SEARCH = the entry number where <string3> was found.
  1089.            --------------------
  1090.  
  1091.  
  1092.          4.4 - Viewing & Writing
  1093.          ═══════════════════════
  1094.  
  1095.          ╔════════════════════════════════════════════════════════════════╗
  1096.          ║** Note:All commands marked with a (*) before the description **║
  1097.          ║**      will only work properly if implemented from within    **║
  1098.          ║**      a script that was called from a function block that   **║
  1099.          ║**      has DBGroup(s) listed in it.  They take the letters   **║
  1100.          ║**      for the DBGroups to use from the second line of the   **║
  1101.          ║**      .FB the script was called from.  The DBGROUP and DB   **║
  1102.          ║**      commands do not affect any of these commands.         **║
  1103.          ╚════════════════════════════════════════════════════════════════╝
  1104.  
  1105.                These commands allow the user to view messages and move
  1106.            around within your databases.
  1107.  
  1108.          CHOOSETOPIC <---
  1109.  
  1110.          (*)   This command lists all the DBGroups (also known as topics)
  1111.            and allows the user to switch over to a different one.  The
  1112.            user can also view an index of all databases available from
  1113.            within this option.
  1114.  
  1115.          LISTBASES <---
  1116.  
  1117.          (*)   This lists all the DB's in the current DBGroup.
  1118.  
  1119.          NEXTBASE <---
  1120.          PREVBASE <---
  1121.  
  1122.                These commands move to the next or previous database within
  1123.            the selected DBGroup, respectively.
  1124.  
  1125.  
  1126.                                              VSCRIPT Documentation -- 20
  1127.  
  1128.  
  1129.          POST <---
  1130.  
  1131.                This lets the user to enter a message into the active DB.
  1132.  
  1133.          READSEQMSG <---
  1134.  
  1135.                This command allows the user to read the messages within
  1136.            the current database.  It also contains a search feature.
  1137.  
  1138.          READNEWMSG <---
  1139.  
  1140.                This starts the user's new message scan, showing all new
  1141.            messages in databases that are in the user's quick-scan list.
  1142.  
  1143.  
  1144.          SCANMSG <---
  1145.  
  1146.                This command brings up a summary of the messages in the
  1147.            selected database.  The user can select a message to read from
  1148.            this listing and has access to all sub-menu commands while
  1149.            reading the messages.
  1150.  
  1151.          SELECTBASE <---
  1152.  
  1153.          (*)   This command lists all the bases and then allows the user
  1154.            to select a different DB as the current one.  The user can
  1155.            also switch to a different DBGroup with this command.
  1156.  
  1157.          SETQUICKSCAN <---
  1158.  
  1159.          (*)   This command allows the user to select what databases he or
  1160.            she would like to view during a new message scan.
  1161.  
  1162.  
  1163.          4.5 - E-mail Functions
  1164.          ══════════════════════
  1165.  
  1166.                The E-mail section of the database structure is a separate
  1167.            entity.  To make it the active database for using the SAVE
  1168.            and BUFFER commands you need to execute the following command:
  1169.  
  1170.          SETEMAIL <---
  1171.  
  1172.               This command is used instead of the DBGROUP & DB commands to
  1173.            make the e-mail section the active database for use with BUFFER
  1174.            and SAVE (see sections 5.x and 4.3, respectively.)
  1175.  
  1176.          FEEDBACK <---
  1177.  
  1178.                This brings up the multi-feedback list (see VBBS.DOC)
  1179.            and prompts the user to send a message to the sysop.
  1180.  
  1181.  
  1182.                                              VSCRIPT Documentation -- 21
  1183.  
  1184.  
  1185.          QUICKMAIL <---
  1186.  
  1187.                This brings up the multi-mail menu for sending e-mail to
  1188.            a group of people all at once.
  1189.  
  1190.          READALLEMAIL <---
  1191.  
  1192.                This is a sysop command that allows you to read all E-mail
  1193.            currently in the system.
  1194.  
  1195.          READEMAILFROM <---
  1196.          READEMAILTO <---
  1197.  
  1198.                These commands allow the user to read all the E-mail FROM
  1199.            them or addressed TO them, respectively.
  1200.  
  1201.          SENDEMAIL <---
  1202.  
  1203.                This command allows the user to send E-mail to other users.
  1204.  
  1205.  
  1206.                                              VSCRIPT Documentation -- 22
  1207.  
  1208.  
  1209.          ╔════════════════════════════════════════════════════════════════╗
  1210.          ║ (5) BUFFER OPERATION & USE                                     ║
  1211.          ╚════════════════════════════════════════════════════════════════╝
  1212.  
  1213.  
  1214.                In order to accommodate larger memo sizes VBBS uses a disk
  1215.            file buffer in the format Bx.TMP, where x is the channel number
  1216.            that the user is on.  This file is stored in the \VBBS dir. The
  1217.            commands used to access the buffer are listed below.
  1218.  
  1219.          BUFFER APPEND ->  BUFFER APPEND <string1>
  1220.  
  1221.                This adds <string1> to the present buffer.
  1222.  
  1223.          BUFFER CLEAR <---
  1224.  
  1225.                This erases the contents of the present buffer.
  1226.  
  1227.          BUFFER EDIT <---
  1228.  
  1229.                This command loads up the user's selected editor and puts
  1230.            the current contents of the buffer into it.  Note:  When using
  1231.            the full-screen editor the user can edit, add, or clear the
  1232.            buffer.  The line editor will only allow you to add lines to
  1233.            the current buffer or clear it.  The user can clear the buffer
  1234.            by aborting out of either editor.
  1235.  
  1236.          BUFFER LIST <---
  1237.  
  1238.                This prints the current buffer contents to the screen. If
  1239.            the user is in ASCII mode then heart-code ANSI is not shown on
  1240.            screen but remains within the buffer file.
  1241.  
  1242.  
  1243.                                              VSCRIPT Documentation -- 23
  1244.  
  1245.  
  1246.          ╔════════════════════════════════════════════════════════════════╗
  1247.          ║ (6) FILE COMMANDS                                              ║
  1248.          ╚════════════════════════════════════════════════════════════════╝
  1249.  
  1250.          ╔════════════════════════════════════════════════════════════════╗
  1251.          ║** Note:All commands marked with a (*) before the description **║
  1252.          ║**      will only work properly if implemented from within    **║
  1253.          ║**      a script that was called from a function block that   **║
  1254.          ║**      has DBGroup(s) listed in it.  They take the letters   **║
  1255.          ║**      for the DBGroups to use from the second line of the   **║
  1256.          ║**      .FB the script was called from.  The DBGROUP and DB   **║
  1257.          ║**      commands do not affect any of these commands.         **║
  1258.          ╚════════════════════════════════════════════════════════════════╝
  1259.  
  1260.          6.1 - Information Commands
  1261.          ══════════════════════════
  1262.  
  1263.          CHECKFILE ->  CHECKFILE <variable1> <pathfile2>
  1264.  
  1265.                This command checks to see if <pathfile2> exists on your
  1266.            system and places the file size into <variable1>.  It returns
  1267.            a 0 if the file does not exist.
  1268.  
  1269.          FINDFIRST ->  FINDFIRST <variable1> <pathfile2>
  1270.          FINDNEXT ->  FINDNEXT <variable1>
  1271.  
  1272.                These commands search for the file mask <pathfile2>. It may
  1273.            include globals and will default to the \VBBS directory if no
  1274.            path is specified.  You must execute FINDFIRST once before you
  1275.            can use the FINDNEXT command.  Both commands will return the
  1276.            full filename to <variable1> or a "" if no match is found.
  1277.  
  1278.          FINDFILES <---
  1279.  
  1280.          (*)   This asks the user for search text and asks if the user
  1281.            would like to search all topic areas.  It then searches all the
  1282.            files in the selected DBGroup(s) and searches the descriptions
  1283.            for those that contain the search text.
  1284.  
  1285.          LISTFILES <---
  1286.  
  1287.                This prompts for a filename (wildcards accepted) and then
  1288.            lists all matching files in the current database.
  1289.  
  1290.          NEWFILES <---
  1291.  
  1292.          (*)   This command asks the user would like to scan all topic
  1293.            areas and then lists all new files in the selected DBGroup(s).
  1294.  
  1295.          RATIO <---
  1296.  
  1297.                This displays the user's upload/download ratio.
  1298.  
  1299.  
  1300.                                              VSCRIPT Documentation -- 24
  1301.  
  1302.  
  1303.          REVIEWFILE <---
  1304.  
  1305.                This command allows the user to review any of the files in
  1306.            the current database.  They can they be downloaded or tagged
  1307.            for a batch download later.
  1308.  
  1309.          REVIEWUPLOADS <---
  1310.  
  1311.          (*)   This command allows the sysop to review all new files that
  1312.            have been uploaded by users.
  1313.  
  1314.  
  1315.          SEARCHALL <---
  1316.  
  1317.          (*)   This works like LISTFILES, but also allows the user to
  1318.            search all topic areas.  It then lists the matching files in
  1319.            the selected DBGroup(s).
  1320.  
  1321.          SETNEWFILESSCAN ->  SETNEWFILESSCAN <value1>
  1322.  
  1323.                This command will set the number of days back a NEWFILES
  1324.            scan equal to <value1>.  If <value1> is left blank then the
  1325.            user will be prompted for the number of days to use.
  1326.  
  1327.          TOPDOWNLOADS <---
  1328.  
  1329.                This lists the top downloads in the active file DBGroup.
  1330.  
  1331.          XFERTIME ->  XFERTIME <variable1> <pathfile2>
  1332.  
  1333.                This command will calculate how long it will take to
  1334.            download <pathfile2> and stores it in <variable1>.  It will
  1335.            return a 0 if the file is not found.
  1336.  
  1337.  
  1338.          6.2 - Transfer Commands
  1339.          ═══════════════════════
  1340.  
  1341.          BATCHDL <---
  1342.  
  1343.                This command brings up the batch transfer menu.
  1344.  
  1345.          DLMASTERLIST <---
  1346.  
  1347.          (*)   This command allows the user to download a zipped listing
  1348.            of your entire transfer section.
  1349.  
  1350.          DOWNLOAD ->  DOWNLOAD <pathfile1>
  1351.  
  1352.                This prompts the user to choose an xfer protocol and then
  1353.            sends the file <pathfile1>.
  1354.  
  1355.  
  1356.                                              VSCRIPT Documentation -- 25
  1357.  
  1358.  
  1359.          DOWNLOADFILE <---
  1360.  
  1361.          (*)   This command prompts for a filename (it accepts wildcards)
  1362.            and then show the user the file's review screen.  The user can
  1363.            then download directly or tag for a batch download.
  1364.  
  1365.          REMOTEUPLOAD <---
  1366.  
  1367.                This allows the user to upload files to the BBS.
  1368.  
  1369.          SYSOPUPLOAD <---
  1370.  
  1371.                This command allows the sysop to upload files locally.
  1372.  
  1373.          UPLOAD ->  UPLOAD <pathfile1>
  1374.  
  1375.                This command prompts the user to choose a protocol and
  1376.            then receives <pathfile1> from the user.  A full path may be
  1377.            used, but is not necessary.
  1378.  
  1379.  
  1380.          6.3 - File Editing
  1381.          ══════════════════
  1382.  
  1383.                VSCRIPT allows you to directly read and write from pure
  1384.            ASCII text files.  The commands to do so are listed here.
  1385.            Note: You must always OPEN a file before performing any of the
  1386.                  other commands and CLOSE it when done, except as noted.
  1387.  
  1388.          EDITFILE <---
  1389.  
  1390.                This allows the sysop to edit any text file with no more
  1391.            than 200 lines.  This is one exception to the OPEN and CLOSE
  1392.            rule, you should not use either with this command.
  1393.  
  1394.          CLOSE <---
  1395.  
  1396.                This closes a file previously opened with OPEN.
  1397.  
  1398.          KILL ->  KILL <pathfile1>
  1399.  
  1400.                This deletes <pathfile1> off of your system.  This is the
  1401.            other exception to the OPEN and CLOSE rule, you should not use
  1402.            either with this command.
  1403.  
  1404.          OPEN ->  OPEN <pathfile1> <option>
  1405.  
  1406.                This command opens a file for use.  One of the following
  1407.            three options must be selected on the command line:
  1408.  
  1409.                 INPUT -> This allows you to READ data in from a file
  1410.                 OUTPUT -> This allows you to create a file and begin
  1411.                           to WRITE new information into it.
  1412.                 APPEND -> This allows you to open an existing file and
  1413.                           WRITE information onto the end of it.
  1414.  
  1415.  
  1416.                                              VSCRIPT Documentation -- 26
  1417.  
  1418.  
  1419.          READ ->  READ <variable1>
  1420.  
  1421.                This will read in a single line from the file and place it
  1422.            into <variable1>.  Multiple READ statements will continue to
  1423.            read in the next line in the file and if the end of the file is
  1424.            reached it will return an !EOF!.  The only way to start at the
  1425.            top of a file again is to CLOSE it and then OPEN it again.
  1426.  
  1427.          WRITE ->  WRITE <token2> <token3> <token4> ... <token7>
  1428.  
  1429.                This command performs exactly like the TR command in
  1430.            section 3.2 with the only difference being that the output
  1431.            goes into a file instead of on screen.
  1432.  
  1433.  
  1434.                                              VSCRIPT Documentation -- 27
  1435.  
  1436.  
  1437.          ╔════════════════════════════════════════════════════════════════╗
  1438.          ║ (7) CONTROL COMMANDS                                           ║
  1439.          ╚════════════════════════════════════════════════════════════════╝
  1440.  
  1441.  
  1442.          7.1 - General Redirection
  1443.          ═════════════════════════
  1444.  
  1445.          # ->  # <label>
  1446.  
  1447.                This command allows you to set points up within your script
  1448.            that the various other control commands can use.
  1449.                    ex:  TR "Hello "
  1450.                         GO skipit
  1451.                         TR "You wont see this text..."
  1452.                         # skipit
  1453.                         TR "Because you just jumped down to here!!"
  1454.  
  1455.          CALL ->  CALL <label>
  1456.  
  1457.                This forces the script to go to <label> and continue to
  1458.            run from there.  When a RET is found the script will go back
  1459.            to the line after the CALL command.
  1460.  
  1461.          GO ->  GO <label>
  1462.  
  1463.                This forces the script to go to <label> just like the CALL
  1464.            command, with the only difference being that it will not return
  1465.            if it encounters an RET statement.
  1466.  
  1467.          RET <---
  1468.  
  1469.                This returns a script from a routine CALLed to the line
  1470.            after the CALL statement.  Note: RET is ignored if there was
  1471.            no CALL statement used.
  1472.  
  1473.  
  1474.          7.2 - Loops and Comparisons
  1475.          ═══════════════════════════
  1476.  
  1477.                VSCRIPT supports some of the more common forms of loops
  1478.            and comparison structures.  These are all covered below but
  1479.            note that the script language can not generally handle nested
  1480.            loops easily, so some testing must be done before you create
  1481.            any scripts using such combinations.
  1482.  
  1483.          7.21 - DO Loops
  1484.          ───────────────
  1485.  
  1486.          ->  DO <variable1> = <value2> <value3>
  1487.                   [body of the loop]
  1488.              LOOP
  1489.  
  1490.                This type of loop begins with <variable1> equal to
  1491.  
  1492.  
  1493.                                              VSCRIPT Documentation -- 28
  1494.  
  1495.  
  1496.            <value2>.  Each time it reaches the LOOP it adds 1 to it
  1497.            and continues until <variable1> is greater than <value3>.
  1498.  
  1499.          ->  DO WHILE <variable1>   {must store a numeric!}
  1500.                   [body of the loop]
  1501.              LOOP
  1502.  
  1503.                This type continues to loop until <variable1> = 0. You
  1504.            must have some way to either exit the loop, or have a place
  1505.            where <variable1> is set to 0 or the script will lock into an
  1506.            endless loop.
  1507.  
  1508.  
  1509.          7.22 - IF/IFVAL Structures
  1510.          ──────────────────────────
  1511.  
  1512.                IF structures allow you to compare 2 strings to see if they
  1513.            match, valid <relation> operators are = and <> ONLY! The IFVAL
  1514.            structures are identical to IF structures, but they are used to
  1515.            compare numeric variables.  Valid IFVAL <relations> are =, >,
  1516.            >=, <, <= and <>.
  1517.  
  1518.          ->  IF <variable1> <relation> <variable2> THEN
  1519.                   [then-code]
  1520.              ENDIF
  1521.  
  1522.                This performs the [then-code] if <relation> is true.
  1523.  
  1524.          ->  IF <variable1> <relation> <variable2> THEN
  1525.                   [then-code]
  1526.              ELSE
  1527.                   [else-code]
  1528.              ENDIF
  1529.  
  1530.                This performs similar to the IF structure, but if the
  1531.            <relation> is false it performs the [else-code].
  1532.  
  1533.  
  1534.          7.23 - TEST/TESTVAL Commands
  1535.          ────────────────────────────
  1536.  
  1537.          ->  TEST <variable1> <relation> <variable2> <label>
  1538.          ->  TESTVAL <variable1> <relation> <variable2> <label>
  1539.  
  1540.                The two TEST commands allow you to compare two variables,
  1541.            and if the comparison is true, to go to a separate part of the
  1542.            script (as if a GO <label> had been used.)  The only difference
  1543.            in the two commands is that TEST performs a non-case-sensitive
  1544.            string comparison and TESTVAL performs a mathematic comparison.
  1545.            Valid <relations> are =, <, <=, >, >= and <>.
  1546.  
  1547.  
  1548.                                              VSCRIPT Documentation -- 29
  1549.  
  1550.  
  1551.          7.3 - Passing Control
  1552.          ═════════════════════
  1553.  
  1554.                There are a total of four ways that you can pass control
  1555.            from a script to something else.  These four ways each have
  1556.            special uses and are covered below.
  1557.  
  1558.                Note: These commands will only accept one token following
  1559.                      the actual command.  If you wish to have more items
  1560.                      on the line then you must place them into a variable
  1561.                      and place the variable on the command line.
  1562.                      ex: $doscom = "dir " & $pathused & " /w"
  1563.                          SHELL $doscom
  1564.  
  1565.          LINK ->  LINK <filename>
  1566.  
  1567.                This command causes the present script to terminate and
  1568.             begin running a script called <filename> (do not use any
  1569.             extension or globals in the filename.)  All of your
  1570.             variables will be cleared before the new script begins
  1571.             operation.
  1572.  
  1573.          EXIT ->  EXIT <filename>
  1574.  
  1575.                This command causes the present script to terminate and
  1576.             then exits to the function block <filename> (as with LINK,
  1577.             do not use extensions or globals.)  If no <filename> is
  1578.             specified then the script will exit to the .FB file that
  1579.             it was called from UNLESS the script did a shrinkout (see
  1580.             DOOR, below) in which case it will always exit to START.FB.
  1581.  
  1582.          SHELL ->  SHELL <pathfile or DOS command line>
  1583.  
  1584.                This will drop to DOS while keeping the BBS in memory.
  1585.             It will then execute the command following SHELL and then
  1586.             return to the line after the SHELL command.  All of your
  1587.             variables are retained because the script is never taken
  1588.             from memory.
  1589.  
  1590.          DOOR ->  DOOR <pathfile or DOS command line>
  1591.  
  1592.                This will shrink the BBS out of memory and drop to DOS.
  1593.             Implementation of the DOOR command writes the dropfiles
  1594.             CHAIN.TXT, DOOR.SYS and DORINFOx.DEF to disk.  If nothing
  1595.             else is specified on the command line then the script will
  1596.             bring up your list of Doors as set in VCONFIG, otherwise it
  1597.             will execute the required command line.  All of the script
  1598.             variables will be cleared by the DOOR command.  After the
  1599.             DOOR has been exited the user will return to the function
  1600.             block that the script was called from unless one of the
  1601.             following two commands are used just before the line that
  1602.             contains the DOOR command:
  1603.  
  1604.  
  1605.                                              VSCRIPT Documentation -- 30
  1606.  
  1607.  
  1608.          RETURNFB -> RETURNFB <function block name>
  1609.          RETURNSCRIPT -> RETURNSCRIPT <script name>
  1610.  
  1611.                If either of these two commands precedes the DOOR command
  1612.             the user will be returned to the function block selected OR
  1613.             the beginning of the selected script.  If an invalid function
  1614.             block name or script name is given it will restore the user to
  1615.             the START.FB function block. If you do not have a START.FB then
  1616.             the BBS will shut down.
  1617.  
  1618.  
  1619.                                              VSCRIPT Documentation -- 31
  1620.  
  1621.  
  1622.          ╔════════════════════════════════════════════════════════════════╗
  1623.          ║ (8) MISCELLANEOUS COMMANDS                                     ║
  1624.          ╚════════════════════════════════════════════════════════════════╝
  1625.  
  1626.                This is the catchall category.  Many useful commands are
  1627.            located in this section that just can't be qualified by a
  1628.            major type.
  1629.  
  1630.          8.1 - Visual/Interactive
  1631.          ════════════════════════
  1632.  
  1633.          AUTOPOST <---
  1634.  
  1635.                This brings up the autopost listing.  See VBBS.DOC for more
  1636.            information on autoposts.
  1637.  
  1638.          LISTCALLERS ->  LISTCALLERS <value1>
  1639.  
  1640.                This command brings up a list of the callers to your BBS
  1641.            for the day.  This will show all of the daily callers if
  1642.            <value1> is left blank or set to a number higher than the
  1643.            total number of callers, otherwise it will show the last
  1644.            <value1> callers.
  1645.  
  1646.          LOGOFF <---
  1647.          LOGOFFYN <---
  1648.  
  1649.                These two commands show the user the LOGOFF.MNU and then
  1650.            log the user off of the BBS. The only difference between the
  1651.            two is that LOGOFFYN prompts the user, while LOGOFF just does
  1652.            it.
  1653.  
  1654.          PAGESYSOP <---
  1655.  
  1656.                This pages the sysop for chat, if available.  See VBBS.DOC
  1657.            for information on chat availability.
  1658.  
  1659.          RANDOM <---
  1660.  
  1661.                This command shows one of your random blurbs from your
  1662.            random blurbs file.  See VBBS.DOC for more information on the
  1663.            random message setup (in VCONFIG).
  1664.  
  1665.          STACK ->  STACK <variable1>
  1666.  
  1667.                This command takes the string in <variable1> and places it
  1668.            into the next input section that the script enters.  This can
  1669.            help make automating multi-keypress functions, like viewing a
  1670.            certain message, easy.  It has been tested and can store at the
  1671.            LEAST 800 characters from 80 '&'ed variables with NO problems.
  1672.            To STACK more than one line of characters for this command just
  1673.            use the '&' operator to add multiple variables into the one
  1674.            <variable1> for use on the STACK line.  If you DOOR out of VBBS
  1675.            or switch to VQWK/VBBS-AUX the information in the stack will be
  1676.            lost and will not be implemented.
  1677.  
  1678.  
  1679.                                              VSCRIPT Documentation -- 32
  1680.  
  1681.  
  1682.          SYSINFO <---
  1683.  
  1684.                This shows the user a listing of the BBS' activity during
  1685.            the current day and over the BBS' lifetime.
  1686.  
  1687.          VALIDATE <---
  1688.  
  1689.                This loads up the network message validation routine. All
  1690.            messages in 'Validate On' subs are located here.
  1691.  
  1692.  
  1693.          WHO <---
  1694.  
  1695.                This command lists who is currently online and what they
  1696.            are doing.  This normally lists the last function block command
  1697.            that was selected or the last ACTION command that was used.
  1698.  
  1699.  
  1700.          8.2 - User Modifiers
  1701.          ════════════════════
  1702.  
  1703.          ACCOUNT <---
  1704.  
  1705.                This brings up the user's default settings and allows the
  1706.            user to change them.
  1707.  
  1708.          ACTION ->  ACTION <string1>
  1709.  
  1710.                This command changes the setting in the <who> command's
  1711.            listing to <string1>.  <string1> can be a maximum of 22
  1712.            characters long.
  1713.  
  1714.          ADDCREDITS ->  ADDCREDITS <value1>
  1715.  
  1716.                This command adds a number of credits = to <value1> to the
  1717.            users account.  <value1> can be positive or negative.
  1718.  
  1719.          ADDTIME ->  ADDTIME <value1>
  1720.  
  1721.                This command adds a number of minutes equal to <value1> to
  1722.            the users time left for the day.  <value1> can be positive or
  1723.            negative.  Note: The change is for the current call ONLY when
  1724.            <value1> is positive but lasts for the entire day if <value1>
  1725.            is negative, so be careful when using a negative value.
  1726.  
  1727.          SETACCFLAG ->  SETACCFLAG <variable1> <option>
  1728.  
  1729.                These are the flags used in VConfig to set up restrictions
  1730.            on your subs.  They are the (h) flags in the user editor and
  1731.            more information on their uses can be found in VBBS.DOC.  The
  1732.            <variable1> can be any letter from A to Z and <option> is either
  1733.            ON or OFF (remember it is case insensitive).
  1734.  
  1735.  
  1736.                                              VSCRIPT Documentation -- 33
  1737.  
  1738.  
  1739.          SETEXTRA ->  SETEXTRA <value1> <string2>
  1740.  
  1741.                There are 8 user-specific variables available for use.
  1742.            Each variable can contain a <string2> of up to 16 characters.
  1743.            The <value1> determines which $EXTRAx will be set.  This is one
  1744.            of the ways you can have info pass between scripts and kept
  1745.            track of during the 'DOOR' command.  See VDOOR.DOC for a full
  1746.            explaination on how this is done.
  1747.  
  1748.  
  1749.          SETFLAGS ->  SETFLAGS <variable1> <option>
  1750.  
  1751.                There are 26 user-specific flags available for use, these
  1752.            are also called general (i) flags.  Each flag is a letter from
  1753.            A to Z and they are toggled with the <option> ON or OFF.  This
  1754.            is another way info can be passed between scripts or saved for
  1755.            use after a 'DOOR' command.  See VDOOR.DOC for an integrated
  1756.            example on how this is done.
  1757.  
  1758.            Special Note - three of the flags have a preset use for VBBS:
  1759.                  A -->  This flag is toggled on/off with the defaults
  1760.                         A>utopost command.
  1761.                  F -->  When this flag is ON the user will use the
  1762.                         built-in Full-Screen Editor.
  1763.                  X -->  When this flag is ON the user will only see
  1764.                         a menu by pressing <?>. Also called expert mode.
  1765.  
  1766.          SETSL -> SETSL <value1>
  1767.  
  1768.                Use this command to alter a users security level as shown
  1769.           by the $security variable.  The <value1> can be any integer value
  1770.           from 0 to 250.  The limit of 250 was set for security reasons.
  1771.  
  1772.          SETTIMELIMIT -> SETTIMELIMIT <value1>
  1773.  
  1774.                This command can be used to increase or decrease a user's
  1775.           maximum time per day as shown by the $maxtime variable.  It will
  1776.           accept any integer from 0 to 240 for <value1> and this value is
  1777.           in minutes per day. The limit of 240 was set for security reasons.
  1778.  
  1779.          USEREDIT <---
  1780.  
  1781.                This command loads the user editor, mostly for sysop use.
  1782.            Only accounts with an SL of 255 can access this feature.
  1783.  
  1784.  
  1785.          8.3 - Real Miscellany
  1786.          ═════════════════════
  1787.  
  1788.          ! ->  ! <put your comments here>
  1789.  
  1790.                Comment line. All text after a '!' is ignored by the
  1791.            script compiler.
  1792.  
  1793.  
  1794.                                              VSCRIPT Documentation -- 34
  1795.  
  1796.  
  1797.          & ->  & <filename>
  1798.  
  1799.                This is an include directive for the VSCRIPT compiler to
  1800.            add in the contents of another script onto the end of the
  1801.            existing code during compilation.  This allows you to write
  1802.            up modular scripts and use them in more than one main script
  1803.            without having to type or block-copy the section in.  Just
  1804.            remember that it adds the code onto the END of the original
  1805.            script, so you must include the GO or CALL statements to get
  1806.            access to the extra sections.  You can also use this function
  1807.  
  1808.  
  1809.            to reduce the size of a single script, as a very long START.V
  1810.            can cause problems when it is run (yet you will have none
  1811.            of the problems if you break into pieces and include them in.)
  1812.  
  1813.          BEEP <---
  1814.  
  1815.                This sends a beep through the computer speaker.
  1816.  
  1817.          DELAY ->  DELAY <value1>
  1818.  
  1819.                This command pauses the script for <value1> seconds.
  1820.  
  1821.          LOG ->  LOG <token2> <token3> <token4> ... <token7>
  1822.  
  1823.                This command writes up to 6 tokens into the daily log
  1824.            file BBS.LOG, located in your \DATA directory.
  1825.  
  1826.  
  1827.  
  1828.                                              VSCRIPT Documentation -- 35
  1829.  
  1830.          ╔════════════════════════════════════════════════════════════════╗
  1831.          ║  APPENDIX A -- VGIX COMMANDS                                   ║
  1832.          ╚════════════════════════════════════════════════════════════════╝
  1833.  
  1834.          ╔════════════════════════════════════════════════════════════════╗
  1835.          ║ Note:  VGIX Commands have no effect when the user is not in    ║
  1836.          ║        VGIX mode.                                              ║
  1837.          ╚════════════════════════════════════════════════════════════════╝
  1838.  
  1839.          CLS <---
  1840.  
  1841.                This command clears the user's screen.
  1842.  
  1843.  
  1844.          COLOR ->  COLOR <color>
  1845.  
  1846.               Set the current color for text and graphics.
  1847.  
  1848.          LINE ->  LINE <x> <y> <x2> <y2> <color> <boxflag>
  1849.  
  1850.                This command draws a line or box on the user's screen,
  1851.            starting at point <x>,<y> to point <x2>,<y2> using the
  1852.            <color> specified. If <boxflag> = 0 a line is drawn,
  1853.            if <boxflag> = 1, a box is drawn.
  1854.  
  1855.          ╔════════════════════════════════════════════════════════════════╗
  1856.          ║ Note:  <x> and <x2> have an allowable range of 0 to 639.       ║
  1857.          ║        <y> and <y2> have an allowable range of 0 to 479.       ║
  1858.          ║        <color> is one of the following:                        ║
  1859.          ║  0=Black      1=Blue           2=Green        3=Cyan           ║
  1860.          ║  4=Red        5=Magenta        6=Brown        7=Grey           ║
  1861.          ║  8=Dark Grey  9=Light Blue     10=Light Green 11=Light Cyan    ║
  1862.          ║  12=Light Red 13=Light Magenta 14=Yellow      15=Bright White  ║
  1863.          ╚════════════════════════════════════════════════════════════════╝
  1864.  
  1865.          PLOT ->  PLOT <x> <y> <color>
  1866.  
  1867.                Set the pixel at <x>,<y> using the <color> specified.
  1868.  
  1869.          CIRCLE ->  CIRCLE <x> <y> <radius> <color>
  1870.  
  1871.                Draw a circle, with an origin at <x>,<y>, using
  1872.            the <radius> and <color> given. Allowable ranges for
  1873.            <radius> are 1 to  639.
  1874.  
  1875.          PAINT ->  PAINT <x> <y> <color> <bordercolor>
  1876.  
  1877.                This command paints an area starting at point <x> <y>
  1878.            using <color>. <Bordercolor> specifies the color at which
  1879.            painting should stop. You would typically use CIRCLE,
  1880.            LINE (in box mode), or PLOT to 'outline' the shape you
  1881.            wanted paint to paint, and then you would use PAINT
  1882.            to fill your shape with color.
  1883.  
  1884.  
  1885.                                              VSCRIPT Documentation -- 36
  1886.  
  1887.  
  1888.          DRAW ->  DRAW <actionstring>
  1889.  
  1890.                <Actionstring> refers to a string of characters:
  1891.            An example might be "U4RU2R5D10L20"
  1892.            This would draw moving the "pen" UP 4, RIGHT 1, UP 2,
  1893.            RIGHT 5, DOWN 10, LEFT 20.
  1894.  
  1895.            <actionstring> commands:
  1896.                U Up
  1897.                D Down
  1898.                R Right
  1899.                L Left
  1900.  
  1901.          PLAY ->  PLAY <musicstring>
  1902.  
  1903.                This command plays music on the remote user's computer.
  1904.            When used with high (fast) tempos, it can also be used to
  1905.            make sound effects. No special sound/music hardware is
  1906.            required.
  1907.  
  1908.            <Musicstring> refers to a string of text such as:
  1909.            "ABCDEFGO4L4T100" = Notes A thru G, go to Octave 4,
  1910.            note Length 1/4, Tempo 100.
  1911.  
  1912.            <musicstring> commands:
  1913.                A-G Notes A thru G
  1914.                O   Set Octave (1 to 5)
  1915.                L   Set Length (1 to 255 representing 1/1 to 1/255)
  1916.                T   Tempo (1 to 255, 1=Slow, 255=Extremely Fast)
  1917.                +   Sharp (Eg "A+" would play A sharp)
  1918.                -   Flat  (Eg "A-" would play A flat)
  1919.  
  1920.          ICONIFY <---
  1921.  
  1922.                This command resets the VGIX ICON "counter."
  1923.  
  1924.          ICON ->  ICON <iconname> <x> <y> <orflag> <key> <caption>
  1925.  
  1926.                This command displays a VGIX Icon on the user's screen.
  1927.            <Iconname> is a 12 character icon name.
  1928.            <X> and <y> are coordinates on the screen where icon is
  1929.            to be displayed.
  1930.            <Orflag>: 0 = SET ICON, 1 = OVERLAY ICON (over a background)
  1931.            <Key> refers to the keystroke to return if this icon is
  1932.            selected by the user via the mouse.
  1933.            <Caption> refers to the text to be printed under the icon.
  1934.            Captions are automatically centered beneath the icon.
  1935.  
  1936.            Note: If key and caption are absent, the icon is NOT "counted"
  1937.            and is not mouseable. Both key and caption must be present for
  1938.            the icon to be mouseable.
  1939.  
  1940.  
  1941.                                              VSCRIPT Documentation -- 37
  1942.  
  1943.  
  1944.          ╔════════════════════════════════════════════════════════════════╗
  1945.          ║  APPENDIX B -- PROGRAMMER'S REFERENCE GUIDE                    ║
  1946.          ╚════════════════════════════════════════════════════════════════╝
  1947.  
  1948.                 This guide is a collection of the command formats for all
  1949.          the commands contained in the Virtual Script Language.  If you
  1950.          need more detail on a command all you need to do is look in the
  1951.          corresponding section in the VSCRIPT.DOC.  All the commands are
  1952.          listed in the exact same format in both places so you may also
  1953.          do a text search for the command line.  Make sure that you read
  1954.          sections 1.4 and 1.5 for a listing of the format definitions and
  1955.          the list of restricted variables.
  1956.  
  1957.          ═════════════════════════════════════════════════════════════════
  1958.  
  1959.          Section 2.1 - Numeric Operators
  1960.          ═══════════════════════════════
  1961.  
  1962.                +   -   *   /   ^
  1963.  
  1964.  
  1965.          Section 2.2 - Numeric Functions
  1966.          ═══════════════════════════════
  1967.  
  1968.                  INT 0 ->  <variable1> = <value2> INT 0
  1969.                  SQR 0 ->  <variable1> = <value2> SQR 0
  1970.                    RND ->  <variable1> = <value1> RND <value2>
  1971.  
  1972.  
  1973.          Section 2.3 - String Operators
  1974.          ══════════════════════════════
  1975.  
  1976.                      & ->  <variable1> = <token3> & <token5> & <token7>
  1977.  
  1978.  
  1979.          Section 2.4 - String Functions
  1980.          ══════════════════════════════
  1981.  
  1982.                  ASC 0 ->  <variable1> = <string2> ASC 0
  1983.                  CHR 0 ->  <variable1> = <value2> CHR 0
  1984.                  LEN 0 ->  <variable1> = <string2> LEN 0
  1985.                UPPER 0 ->  <variable1> = <string2> UPPER 0
  1986.                  INSTR ->  <variable1> = <string2> INSTR <string3>
  1987.                    MID ->  <variable1> = <string2> MID <value3>
  1988.                   LEFT ->  <variable1> = <string2> LEFT <value3>
  1989.  
  1990.  
  1991.          Section 2.5 - String Alterations
  1992.          ════════════════════════════════
  1993.  
  1994.                     JC ->  JC <variable1> <value2>
  1995.                     JL ->  JL <variable1> <value2>
  1996.                     JR ->  JR <variable1> <value2>
  1997.  
  1998.  
  1999.                                              VSCRIPT Documentation -- 38
  2000.  
  2001.  
  2002.          Section 3.1 - Reading Input
  2003.          ═══════════════════════════
  2004.  
  2005.                  GETYN ->  GETYN <variable1> <prompt>
  2006.                  GETNY ->  GETNY <variable1> <prompt>
  2007.                     RS ->  RS <variable1> <prompt>
  2008.                     RX ->  RX <variable1> <prompt>
  2009.                     RW ->  RW <variable1> <prompt>
  2010.                     RN ->  RN <variable1> <prompt>
  2011.                     RC ->  RC <variable1> <prompt>
  2012.                     RR ->  RR <variable1> <string2> <prompt>
  2013.                     RL ->  RL <variable1> <string2> <value3> <prompt>
  2014.                     RF ->  RF <variable1> <prompt>
  2015.                     RI ->  RI <variable1> <prompt>
  2016.  
  2017.  
  2018.          Section 3.2 - Showing Line Output
  2019.          ═════════════════════════════════
  2020.  
  2021.                     TR ->  TR <token2> <token3> <token4> ... <token7>
  2022.                     TS ->  TS <token2> <token3> <token4> ... <token7>
  2023.                     %s ->  %s<number1> <variable2>
  2024.                     %i ->  %i<number1> <variable2>
  2025.                     %d ->  %d<number1>.<number2> <value3>
  2026.  
  2027.  
  2028.          Section 3.3 - Colorization
  2029.          ══════════════════════════
  2030.  
  2031.                  ANSIC ->  ANSIC <color code>
  2032.               $<color> ->  $RED, $BLUE, $GREEN, $YELLOW, $MAGENTA,
  2033.                            $CYAN, $WHITE, $NORM, $BLACK
  2034.                 Hearts ->  See description in main section.
  2035.  
  2036.  
  2037.          Section 3.4 - Other Display Commands
  2038.          ════════════════════════════════════
  2039.  
  2040.                         EF ->  EF <pathfile1>
  2041.                DRAWWAITBAR ->  DRAWWAITBAR <value1>
  2042.                        LOC ->  LOC <value1> <value2>
  2043.                       MENU ->  MENU <filename1>
  2044.                    NEWPAGE <---
  2045.           SUSPENDPAGEBREAK <---
  2046.            RESUMEPAGEBREAK <---
  2047.                      PAUSE ->  PAUSE <prompt>
  2048.  
  2049.  
  2050.          Section 4.1 - Database Selection
  2051.          ════════════════════════════════
  2052.  
  2053.                DBGROUP ->  DBGROUP <group identifier>
  2054.                     DB ->  DB <database number>
  2055.  
  2056.  
  2057.                                              VSCRIPT Documentation -- 39
  2058.  
  2059.  
  2060.          Section 4.2 - LOAD Related Commands
  2061.          ═══════════════════════════════════
  2062.  
  2063.                   LOAD ->  LOAD <value1> <option>
  2064.             DISPLAYMSG <---
  2065.            DISPLAYTEXT <---
  2066.  
  2067.  
  2068.          Section 4.3 - Editing Commands
  2069.          ══════════════════════════════
  2070.  
  2071.              ADDCOUNT ->  ADDCOUNT <value1>
  2072.               CLEANUP <---
  2073.                DBFLAG ->  DBFLAG <value1> <switch>
  2074.                   DEL ->  DEL <value1>
  2075.                  PACK <---
  2076.                    QS ->  QS <value1>
  2077.                  SAVE ->  See description in main section.
  2078.                 SEARCH ->  SEARCH <value1> <number2> <string3>
  2079.  
  2080.  
  2081.          Section 4.4 - Viewing & Writing
  2082.          ═══════════════════════════════
  2083.  
  2084.            CHOOSETOPIC <---
  2085.              LISTBASES <---
  2086.               NEXTBASE <---
  2087.               PREVBASE <---
  2088.                   POST <---
  2089.             READSEQMSG <---
  2090.             READNEWMSG <---
  2091.                SCANMSG <---
  2092.             SELECTBASE <---
  2093.           SETQUICKSCAN <---
  2094.  
  2095.  
  2096.          Section 4.5 - E-Mail Functions
  2097.          ══════════════════════════════
  2098.  
  2099.                SETEMAIL <---
  2100.                FEEDBACK <---
  2101.               QUICKMAIL <---
  2102.            READALLEMAIL <---
  2103.           READEMAILFROM <---
  2104.             READEMAILTO <---
  2105.               SENDEMAIL <---
  2106.  
  2107.  
  2108.          Section 5.1 - Buffer Commands
  2109.          ═════════════════════════════
  2110.  
  2111.           BUFFER APPEND ->  BUFFER APPEND <string1>
  2112.            BUFFER CLEAR <---
  2113.             BUFFER EDIT <---
  2114.             BUFFER LIST <---
  2115.  
  2116.  
  2117.                                              VSCRIPT Documentation -- 40
  2118.  
  2119.  
  2120.          Section 6.1 - Information Commands
  2121.          ══════════════════════════════════
  2122.  
  2123.                CHECKFILE ->  CHECKFILE <variable1> <pathfile2>
  2124.                FINDFIRST ->  FINDFIRST <variable1> <pathfile2>
  2125.                 FINDNEXT ->  FINDNEXT <variable1>
  2126.                FINDFILES <---
  2127.                LISTFILES <---
  2128.                 NEWFILES <---
  2129.                    RATIO <---
  2130.               REVIEWFILE <---
  2131.            REVIEWUPLOADS <---
  2132.          SETNEWFILESSCAN ->  SETNEWFILESSCAN <value1>
  2133.                SEARCHALL <---
  2134.             TOPDOWNLOADS <---
  2135.                 XFERTIME ->  XFERTIME <variable1> <pathfile2>
  2136.  
  2137.  
  2138.          Section 6.2 - Transfer Commands
  2139.          ═══════════════════════════════
  2140.  
  2141.                BATCHDL <---
  2142.           DLMASTERLIST <---
  2143.               DOWNLOAD ->  DOWNLOAD <pathfile1>
  2144.           DOWNLOADFILE <---
  2145.           REMOTEUPLOAD <---
  2146.            SYSOPUPLOAD <---
  2147.                 UPLOAD ->  UPLOAD <pathfile1>
  2148.  
  2149.  
  2150.          Section 6.3 - File Editing
  2151.          ══════════════════════════
  2152.  
  2153.               EDITFILE <---
  2154.                  CLOSE <---
  2155.                   KILL ->  KILL <pathfile1>
  2156.                   OPEN ->  OPEN <pathfile1> <option>
  2157.                            <option> = INPUT, OUTPUT, APPEND
  2158.                   READ ->  READ <variable1>
  2159.                  WRITE ->  WRITE <token2> <token3> <token4> ... <token7>
  2160.  
  2161.  
  2162.  
  2163.  
  2164.          Section 7.1 - General Redirection
  2165.          ═════════════════════════════════
  2166.  
  2167.                      # ->  # <label>
  2168.                   CALL ->  CALL <label>
  2169.                     GO ->  GO <label>
  2170.                    RET <---
  2171.  
  2172.  
  2173.                                              VSCRIPT Documentation -- 41
  2174.  
  2175.  
  2176.          Section 7.2 - Loops and Comparisons
  2177.          ═══════════════════════════════════
  2178.  
  2179.            Section 7.21 - DO Loops
  2180.            ───────────────────────
  2181.  
  2182.              ->  DO <variable1> = <value2> <value3>
  2183.                     [body of the loop]
  2184.                  LOOP
  2185.  
  2186.              ->  DO WHILE <variable1>   {must store a numeric!}
  2187.                     [body of the loop]
  2188.                  LOOP
  2189.  
  2190.            Section 7.22 - IF/IFVAL Structures
  2191.            ──────────────────────────────────
  2192.  
  2193.              ->  IF <variable1> <relation> <variable2> THEN
  2194.                     [then-code]
  2195.                  ENDIF
  2196.  
  2197.              ->  IF <variable1> <relation> <variable2> THEN
  2198.                     [then-code]
  2199.                  ELSE
  2200.                     [else-code]
  2201.                  ENDIF
  2202.  
  2203.  
  2204.          Section 7.23 - TEST/TESTVAL Commands
  2205.          ════════════════════════════════════
  2206.  
  2207.          ->  TEST <variable1> <relation> <variable2> <label>
  2208.          ->  TESTVAL <variable1> <relation> <variable2> <label>
  2209.  
  2210.  
  2211.          Section 7.3 - Passing Control
  2212.          ═════════════════════════════
  2213.  
  2214.                   LINK ->  LINK <filename>
  2215.                   EXIT ->  EXIT <filename>
  2216.                  SHELL ->  SHELL <pathfile or DOS command line>
  2217.                   DOOR ->  DOOR <pathfile or DOS command line>
  2218.               RETURNFB -> RETURNFB <function block name>
  2219.           RETURNSCRIPT -> RETURNSCRIPT <script name>
  2220.  
  2221.  
  2222.                                              VSCRIPT Documentation -- 42
  2223.  
  2224.  
  2225.          Section 8.1 - Visual/Interactive
  2226.          ════════════════════════════════
  2227.  
  2228.               AUTOPOST <---
  2229.            LISTCALLERS ->  LISTCALLERS <value1>
  2230.                 LOGOFF <---
  2231.               LOGOFFYN <---
  2232.              PAGESYSOP <---
  2233.                 RANDOM <---
  2234.                  STACK ->  STACK <variable1>
  2235.                SYSINFO <---
  2236.               VALIDATE <---
  2237.                    WHO <---
  2238.  
  2239.  
  2240.          Section 8.2 - User Modifiers
  2241.          ════════════════════════════
  2242.  
  2243.                ACCOUNT <---
  2244.                 ACTION ->  ACTION <string1>
  2245.             ADDCREDITS ->  ADDCREDITS <value1>
  2246.                ADDTIME ->  ADDTIME <value1>
  2247.             SETACCFLAG ->  SETACCFLAG <value1> <option>
  2248.                            <option> = ON, OFF
  2249.               SETEXTRA ->  SETEXTRA <value1> <string2>
  2250.               SETFLAGS ->  SETFLAGS <variable1> <option>
  2251.                            <option> = ON, OFF
  2252.                  SETSL ->  SETSL <value1>
  2253.           SETTIMELIMIT ->  SETTIMELIMIT <value1>
  2254.               USEREDIT <---
  2255.  
  2256.  
  2257.          Section 8.3 - Real Miscellany
  2258.          ═════════════════════════════
  2259.  
  2260.                      ! ->  ! <put your comments here>
  2261.                      & ->  & <filename>
  2262.                   BEEP <---
  2263.                  DELAY ->  DELAY <value1>
  2264.                    LOG ->  LOG <token2> <token3> <token4> ... <token7>
  2265.  
  2266.  
  2267.          Appendix A - VGIX Commands
  2268.          ══════════════════════════
  2269.  
  2270.                    CLS <---
  2271.                  COLOR ->  COLOR <color>
  2272.                   LINE ->  LINE <x> <y> <x2> <y2> <color> <boxflag>
  2273.                   PLOT ->  PLOT <x> <y> <color>
  2274.                 CIRCLE ->  CIRCLE <x> <y> <radius> <color>
  2275.                  PAINT ->  PAINT <x> <y> <color> <bordercolor>
  2276.                   DRAW ->  DRAW <actionstring>
  2277.                   PLAY ->  PLAY <musicstring>
  2278.                ICONIFY <---
  2279.                   ICON ->  ICON <iconname> <x> <y> <orflag> <key> <capt.>
  2280.  
  2281.  
  2282.                                              VSCRIPT Documentation -- 43
  2283.  
  2284.  
  2285.          ╔════════════════════════════════════════════════════════════════╗
  2286.          ║  APPENDIX C -- SCRIPT/FUNCTION BLOCK COMMANDS                  ║
  2287.          ╚════════════════════════════════════════════════════════════════╝
  2288.  
  2289.                 What follows is a list of all of the script commands that
  2290.          can be used in a function block (.FB) file.  Any special rules that
  2291.          apply to the command when used in a .FB file will be listed after
  2292.          the command.  The commands are broken down by the sections
  2293.          in the main part of this documentation that they are listed in.
  2294.  
  2295.          ═════════════════════════════════════════════════════════════════
  2296.  
  2297.          Section 4.3 - Editing Commands
  2298.          ══════════════════════════════
  2299.  
  2300.               CLEANUP <---
  2301.  
  2302.          Section 4.4 - Viewing & Writing
  2303.          ═══════════════════════════════
  2304.  
  2305.            CHOOSETOPIC <---
  2306.              LISTBASES <---
  2307.               NEXTBASE <---
  2308.               PREVBASE <---
  2309.                   POST <---
  2310.             READSEQMSG <---
  2311.             READNEWMSG <---
  2312.                SCANMSG <---
  2313.             SELECTBASE <---
  2314.           SETQUICKSCAN <---
  2315.  
  2316.          Section 4.5 - E-Mail Functions
  2317.          ══════════════════════════════
  2318.  
  2319.                FEEDBACK <---
  2320.               QUICKMAIL <---
  2321.            READALLEMAIL <---
  2322.           READEMAILFROM <---
  2323.             READEMAILTO <---
  2324.               SENDEMAIL <---
  2325.  
  2326.          Section 6.1 - Information Commands
  2327.          ══════════════════════════════════
  2328.  
  2329.                FINDFILES <---
  2330.                LISTFILES <---
  2331.                 NEWFILES <---
  2332.                    RATIO <---
  2333.               REVIEWFILE <---
  2334.            REVIEWUPLOADS <---
  2335.          SETNEWFILESSCAN <---
  2336.                              This command can only be used to prompt
  2337.                              the user for number of days to scan.
  2338.                SEARCHALL <---
  2339.             TOPDOWNLOADS <---
  2340.  
  2341.  
  2342.                                              VSCRIPT Documentation -- 44
  2343.  
  2344.  
  2345.          Section 6.2 - Transfer Commands
  2346.          ═══════════════════════════════
  2347.  
  2348.                BATCHDL <---
  2349.           DLMASTERLIST <---
  2350.           DOWNLOADFILE <---
  2351.           REMOTEUPLOAD <---
  2352.            SYSOPUPLOAD <---
  2353.  
  2354.          Section 6.3 - File Editing
  2355.          ══════════════════════════
  2356.  
  2357.               EDITFILE <---
  2358.  
  2359.          Section 8.1 - Visual/Interactive
  2360.          ════════════════════════════════
  2361.  
  2362.               AUTOPOST <---
  2363.            LISTCALLERS <---
  2364.                            This command can only be used to list all
  2365.                            the callers for the current day.
  2366.                 LOGOFF <---
  2367.               LOGOFFYN <---
  2368.              PAGESYSOP <---
  2369.                 RANDOM <---
  2370.                SYSINFO <---
  2371.               VALIDATE <---
  2372.                    WHO <---
  2373.  
  2374.          Section 8.2 - User Modifiers
  2375.          ════════════════════════════
  2376.  
  2377.                ACCOUNT <---
  2378.               USEREDIT <---
  2379.  
  2380.          Section 8.3 - Real Miscellany
  2381.          ═════════════════════════════
  2382.  
  2383.                   BEEP <---
  2384.  
  2385.          ═════════════════════════════════════════════════════════════════
  2386.  
  2387.             What follows is a keyboard layout showing all of the available
  2388.          symbols that may be used within a function block (.FB).  All other
  2389.          symbols are unusable and may cause the BBS to lock (&), do nothing
  2390.          (%), or give a menu (?).  Also note that you can not use lowercase
  2391.          letters in your function block as they are ignored by VBBS, which
  2392.          assumes uppercase for all alphabetic characters entered by the
  2393.          user.  It is also possible to use extended ASCII characters in a
  2394.          function block, although they have not all been tested.
  2395.  
  2396.              ~`   !   @   #   $       ^       *   (   ) -_ += \|
  2397.                   Q   W   E   R   T   Y   U   I   O   P  [{ ]}
  2398.                    A   S   D   F   G   H   J   K   L   ;: '"
  2399.                     Z   X   C   V   B   N   M   ,<  .>  /
  2400.  
  2401.  
  2402.                                              VSCRIPT Documentation -- 45
  2403.  
  2404.  
  2405.          ╔════════════════════════════════════════════════════════════════╗
  2406.          ║  APPENDIX D -- COMMON SCRIPT EXAMPLES & EXPLANATIONS           ║
  2407.          ╚════════════════════════════════════════════════════════════════╝
  2408.  
  2409.          ╔════════════════════════════════════════════════════════════════╗
  2410.          ║ Note:  While all the following scripts were written by other   ║
  2411.          ║        authors they have all undergone modification to improve ║
  2412.          ║        their clarity and/or add in new features found in 6.10. ║
  2413.          ║        The first few scripts are general examples, while the   ║
  2414.          ║        later group of scripts are specific examples of some of ║
  2415.          ║        the more complex scripting command sequences.           ║
  2416.          ╚════════════════════════════════════════════════════════════════╝
  2417.  
  2418.           Question: How do I figure out if it is a user's birthday?
  2419.           Answer: Place this section of code into the script that you
  2420.                   wish to have show the birthday greeting.
  2421.  
  2422.            !=============================================================
  2423.            !                       Unknown Author
  2424.            !=============================================================
  2425.            $bmonth = $birthdate LEFT 2
  2426.            $month = $date LEFT 2
  2427.            $bday = $birthdate MID 4 LEFT 2
  2428.            $day = $date MID 4 LEFT 2
  2429.            TESTVAL $bmonth <> $month NOTNOW
  2430.            IFVAL $bday = $day THEN
  2431.               <place your birthday message here>
  2432.            ENDIF
  2433.            # NOTNOW
  2434.            !=============================================================
  2435.  
  2436.           Question: I would like to know when I have new messages to be
  2437.                     validated for my networked subs when I log on.
  2438.           Answer: Place this section of code into your START.V file
  2439.                   anywhere before you exit.
  2440.  
  2441.            !=============================================================
  2442.            !          Originally written by Ken 1@8051 VirtualNET
  2443.            !=============================================================
  2444.            testval $security < 254 nothere
  2445.            $found = "VALIDATE.0"
  2446.            findfirst $validmsg "c:\vbbs\data\validate.0"
  2447.            test $validmsg <> $found nothere
  2448.            # again
  2449.            tr
  2450.            getny $choice " 5New messages to VALIDATE. 6 Validate Now? "
  2451.            if $choice = "Y" then
  2452.               validate
  2453.            endif
  2454.            # NOTHERE
  2455.            !=============================================================
  2456.            !    Note:  This ONLY works for VirtualNET message bases.
  2457.            !=============================================================
  2458.  
  2459.  
  2460.                                              VSCRIPT Documentation -- 46
  2461.  
  2462.  
  2463.           Question: How do I set up a simple downloads area for special
  2464.                     files like virus scanners and compression utilities?
  2465.           Answer: Just edit the following script to show the correct paths
  2466.                   and filenames for the files, add in the command to run
  2467.                   the script from a function block (ex: G 001 2 SHOPPING).
  2468.                   Then all you need to do is create a .MNU file (or a .ANS
  2469.                   and .ASC pair) listing the user's choices and place it
  2470.                   into your \TXT directory and away you go.
  2471.  
  2472.            !=============================================================
  2473.            !        Originally written by O. F. 1@2056 VirtualNET
  2474.            !=============================================================
  2475.            Example SHOP.MNU file:
  2476.  
  2477.                         Available files for quick download are:
  2478.                A> ARJ230.EXE    - Newest ARJ Compression Utility
  2479.                C> CLEAN102.ZIP  - McAfee Virus Cleaning Utility
  2480.                F> FRIES.GIF     - GIF of the lovable '-fries'
  2481.                G> GREMLIN.GIF   - GIF of 'The (verbose tagline) Gremlin'
  2482.                P> PKZIP204G.EXE - Newest PKZip Compression Utility
  2483.                S> SCAN102.ZIP   - McAfee Virus Scanning Utility
  2484.  
  2485.            !=============================================================
  2486.            tr $crlf
  2487.            menu shop
  2488.            tr $crlf
  2489.            rr $selection acfgpsq "Which file would you like ? <Q to quit>"
  2490.            IF $selection = a THEN
  2491.               DOWNLOAD d:\dloads\compress\arj230.exe
  2492.            ELSE
  2493.            IF $selection = c THEN
  2494.               DOWNLOAD d:\dloads\virus\clean102.zip
  2495.            ELSE
  2496.            IF $selection = f THEN
  2497.               DOWNLOAD d:\dloads\gifs\fries.gif
  2498.            ELSE
  2499.            IF $selection = g THEN
  2500.               DOWNLOAD d:\dloads\gifs\gremlin.gif
  2501.            ELSE
  2502.            IF $selection = p THEN
  2503.               DOWNLOAD d:\dloads\compress\pkz204g.exe
  2504.            ELSE
  2505.            IF $selection = s THEN
  2506.               DOWNLOAD d:\dloads\virus\scan102.zip
  2507.            ENDIF
  2508.            tr $crlf
  2509.            exit start
  2510.            ! Make sure the EXIT command above is to a .FB you have !!
  2511.            !=============================================================
  2512.  
  2513.  
  2514.                                              VSCRIPT Documentation -- 47
  2515.  
  2516.  
  2517.           Question: How can I enhance the chat call from my users?  I like
  2518.                     to know WHY they chatted me, even if I am not around.
  2519.           Answer: All you have to do is compile the following script as
  2520.                   CHAT.V and then and change the line in your START.FB from
  2521.                   'l 001 1 ^pagesysop' to 'l 001 2 chat'.
  2522.  
  2523.            !=============================================================
  2524.            !     Originally written by B. B. Woof 1@5096 VirtualNET
  2525.            !=============================================================
  2526.            tr "Why do you wish to page " $sysop
  2527.            tr
  2528.            tr "   >----------------------------------------------------<"
  2529.            rs $reason "=> "
  2530.            tr "   >----------------------------------------------------<"
  2531.            test $reason = "" end
  2532.            $tst = $reason LEFT 5
  2533.            test $tst = "     " end
  2534.            test $available = Y imhere
  2535.            tr
  2536.            tr $sysop " is not currently available, "
  2537.            go feed
  2538.            # imhere
  2539.            tr
  2540.            tr "Paging " $sysop
  2541.            do $count = 1 10
  2542.                ts " 2< 6< 2< 6* 2> 6> 2> " $bell
  2543.            loop
  2544.            tr
  2545.            tr " Please wait 10 seconds for " $sysop " to respond, "
  2546.            tr
  2547.            drawwaitbar 10
  2548.            do $a = 1 10
  2549.               ts "*"
  2550.               delay 1
  2551.            loop
  2552.            tr
  2553.            tr $sysop " doesn't seem to be answering..."
  2554.            # feed
  2555.            getyn $yn "Would you like to leave feedback? (Y/N/enter=yes)"
  2556.            tr
  2557.            if $yn = Y then
  2558.               $s = "     and left feedback as well!"
  2559.               feedback
  2560.            else
  2561.               $s = "     and did not leave feedback!"
  2562.            endif
  2563.            log $handle ", paged you at " $time " on " $date
  2564.            log "Chat reason: " $reason
  2565.            log $s
  2566.            tr
  2567.            # end
  2568.            exit start
  2569.            ! Make sure the EXIT command above is to a .FB you have !!
  2570.            !=============================================================
  2571.  
  2572.  
  2573.                                              VSCRIPT Documentation -- 48
  2574.  
  2575.  
  2576.            !==============================================================
  2577.            !     Buffer Example (see Section 5 for command descriptions)
  2578.            !==============================================================
  2579.            ! EMAIL.V   This sends an E-mail to the Sysop.  To do this we
  2580.            !           create a form letter in the buffer and then write
  2581.            !           the buffer contents to an E-mail addressed to the
  2582.            !           Sysop #1 account.  Note the '!' are comment lines.
  2583.            !
  2584.            !                     Create the form letter
  2585.            $Line1 = $Sysop & ","
  2586.            $Line2 = "  I'm a new user and would really appreciate it"
  2587.            $Line3 = "if you would validate my account."
  2588.            $Line4 = "  Thanks!"
  2589.            $Line5 = "     " & $Handle
  2590.            !                     Clear out any existing buffer contents
  2591.            Buffer Clear
  2592.            !                     Write the text lines to the Buffer
  2593.            Buffer Append $Line1
  2594.            Buffer Append $Line2
  2595.            Buffer Append $Line3
  2596.            Buffer Append $Line4
  2597.            Buffer Append $Line5
  2598.            !                     Position to the E-mail database
  2599.            SetEmail
  2600.            !                     Save the buffer as E-mail to the sysop #1
  2601.            Save 1 $Node "Validation Request" 0 "" 1
  2602.            !                     Clear out the buffer again
  2603.            Buffer Clear
  2604.            !==============================================================
  2605.  
  2606.  
  2607.                                              VSCRIPT Documentation -- 49
  2608.  
  2609.  
  2610.            !==============================================================
  2611.            !     File Editing Example (see Section 6 for command desc.)
  2612.            !==============================================================
  2613.            !  READ.V - Some examples of writing and reading from the
  2614.            !           buffer file.
  2615.            !
  2616.            $Where = $port                        ! this selects the buffer
  2617.            $File = "c:\vbbs\b" & $where & ".tmp" ! for the node you're on
  2618.            !
  2619.            !  Check to see if the file is there; if so, delete it.
  2620.            CHECKFILE $Len $File
  2621.            IFVAL $Len > 0 Then
  2622.               KILL $File
  2623.            ENDIF
  2624.            !  Build an new one, add one line, then close it.
  2625.            OPEN $File OUTPUT
  2626.               WRITE "Your Handle : " $handle
  2627.            CLOSE
  2628.            !  Now open it, add data to the end of it, then close it again.
  2629.            OPEN $File APPEND
  2630.               WRITE "The BBSName : " $bbsname
  2631.               WRITE "Your Baud Rate : " $baud
  2632.               WRITE "The Sysop's Name : " $sysop "  and the time : " $time
  2633.            CLOSE
  2634.            !  Now re-open it, read the data back, print it, and close it.
  2635.            OPEN $File INPUT
  2636.            # Tag
  2637.               READ $Line
  2638.               TEST $Line = "!EOF!" End
  2639.               TR $Line
  2640.               GO Tag
  2641.            # End
  2642.            !  Now close and remove the file
  2643.            CLOSE
  2644.            KILL $File
  2645.            !==============================================================
  2646.  
  2647.                 With very little work you could actually write an editor
  2648.            using the combination of the BUFFER commands and the commands
  2649.            above.  The options are limitless once you set your mind to it.
  2650.  
  2651.  
  2652.                                              VSCRIPT Documentation -- 50
  2653.  
  2654.  
  2655.            !=============================================================
  2656.            !     Control Example (see Section 7 for command descriptions)
  2657.            !=============================================================
  2658.            !  Waiting.V - This is a small script to force the user to
  2659.            !              do nothing for 30 seconds.  It is also an
  2660.            !              example of how to use the various control
  2661.            !              structures to accomplish the same goals.
  2662.            $x = 1
  2663.            $y = 0
  2664.            CALL drawit                      !----------------------------
  2665.            DO $a = 1 10                     !  These
  2666.               CALL slowit                   !    three
  2667.            LOOP                             !      lines
  2668.            CALL drawit                      !----------------------------
  2669.            # again                          !  And
  2670.            IFVAL $x < 11 THEN               !    \
  2671.               CALL slowit                   !    all
  2672.               $x = $x + 1                   !      \
  2673.               GO again                      !      nine
  2674.            ELSE                             !        \
  2675.               GO notagain                   !         of
  2676.            ENDIF                            !          \
  2677.            # notagain                       !           these
  2678.            CALL drawit                      !----------------------------
  2679.            # lastone                        !  And
  2680.               CALL slowit                   !    \
  2681.               $y = $y + 1                   !    these
  2682.               TESTVAL $y = 10 alldone       !       \
  2683.               go lastone                    !        five
  2684.            # alldone                        !----------------------------
  2685.               exit start                    !  do the same thing
  2686.            # drawit                         !----------------------------
  2687.               TR
  2688.               DRAWWAITBAR 10
  2689.            RET
  2690.            # slowit
  2691.               DELAY 1
  2692.               TS "*"
  2693.            RET
  2694.            !=============================================================
  2695.  
  2696.  
  2697.  
  2698.